Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Aug 16, 2017 6:33 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: MsgBox and InputBox for REALbasic?
PostPosted: Fri Mar 08, 2013 7:13 am 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
Visual Basic has built into the language a MsgBox Function and an InputBox Function:

Quote:
MsgBox Function (Visual Basic)
Displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked.

InputBox Function (Visual Basic)
Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box.

REALbasic has built into the language a MsgBox function but not an InputBox function.

For "QuAD" ("QUick And Dirty") programs I find MsgBox in REALbasic to be extremely useful (just as I did in Visual Basic up; to version 6.0). It doesn't look "professional," but it saves a lot of time. I have an idea that I would find an InputBox in REALbasic to be equally useful, but REALbasic does not have an equivalent built into the language.

Which brings me to my questions: Has anyone written an equvalent Function to InputBox for REALbasic? If so, is the code available? (If people are converting Visual Basic programs to REALbasic, these questions must have come up before.)

Thanks in advance for any help on this.

Barry Traver


Top
 Profile  
Reply with quote  
 Post subject: Re: MsgBox and InputBox for REALbasic?
PostPosted: Fri Mar 08, 2013 7:32 am 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
P.S. I know that Dave S. wrote an InputBox equivalent for REALbasic, but I understand that it only runs on the Mac. I'm using Windows, so that won't work for me.

Barry Traver


Top
 Profile  
Reply with quote  
 Post subject: Re: MsgBox and InputBox for REALbasic?
PostPosted: Fri Mar 08, 2013 10:29 am 
Offline
User avatar

Joined: Mon Nov 29, 2010 7:01 pm
Posts: 446
Just make a modal dialog window with an input text field.

Make a prompt event on the window that shows the modal dialog box and returns a value.

The value returned must be a property on the window and not a control as the controls are destroyed before the return value makes it back from the method calling it.

Then you're good to go!

WindowInputDialog.prompt(Message as string, DefaultInput as string = "") return String


To use it, do something like:
Dim response as string = windowInputDialog.prompt("Enter your username:")


Last edited by neonash7777 on Fri Mar 08, 2013 10:34 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: MsgBox and InputBox for REALbasic?
PostPosted: Fri Mar 08, 2013 10:30 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Let me find my code for that...

It SHOULD work for Windows..... with no problem.... I didn't use any OSX specific features.


EDIT :

I found the original code.... and since had update the MSGBOX portion ALOT... but not the INPUTBOX part (as a matter of fact it got left out of the new msgbox code)

If you want ... I will update it with INPUTBOX feature and post it again.

In the meantime.... http://www.rdsisemore.com/mymsgbox.html showed what the previous version did. Some of the custommization has been left out of the new version...

That code BTW was from Apr 2012....

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: MsgBox and InputBox for REALbasic?
PostPosted: Fri Mar 08, 2013 1:21 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
I have a video in my training series on how to do this. I forget the exact video but the Tag Cloud of everything we cover in the series (36+ hours) can be found at http://www.bkeeney.com/bkeeney-tag-and-video-list/

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group