PDA

View Full Version : Missing: Goto Label, Return


SonG0han
12-15-2003, 12:44 PM
hi.
in autoplay 4 you coud use "Goto LABEL" to jump to specific areas of your code and "Return" to "exit" and stop execution of lines below. is there a way to do this in autoplay 5 too?

for example: i want to stop execution of code below if user enters an invalid username but how can i do it? :confused:

hope someone can help.

Corey
12-15-2003, 12:58 PM
Hi, sorry that feature is deprecated.

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

TJ_Tigger
12-15-2003, 01:00 PM
I would look at using functions. Defind your functions on Project->Global Functions and when you are coding use an if statement to perform one or the other.

SonG0han
12-15-2003, 01:04 PM
hmm i will try it with functions :)

but why did you remove it from autplay 5? :(

SonG0han
12-15-2003, 01:16 PM
hm is it possible to call an empty function to do "nothing"?
or must a function contain something? can i use just "Var1 = "";" or something like that if it cant be emtpy to let it do "nothing"? :confused:

Lorne
12-15-2003, 01:39 PM
No need to use functions. Just use an if statement to control whether the code is performed. Like this:

if username ~= "George" then
-- do a bunch of stuff if username isn't "George"
end

SonG0han
12-15-2003, 01:55 PM
hm right, i used an if-statement now
here what i did:


DesiredUserName = Dialog.Input("Enter your desired Registration Name", "Your Name:", "", MB_ICONQUESTION);

if (DesiredUserName == "CANCEL") or (DesiredUserName == "") then
Dialog.Message("Title", "EMPTY!")
else
UserEmail = Dialog.Input("Enter your e-Mail Adress", "Your e-Mail: (must be the address you use to send us your order)", "", MB_ICONQUESTION);
if (UserEmail == "CANCEL") or (UserEmail == "") then
Dialog.Message("Title", "ERROR!")
else
-- WIRTE TEXTFILE or do anything
end
end

:)


seems its not really important to use an emtpy function cause with the if statement i can do "nothing" if it fails, right?

example:
if (bla == "") then

else
-- do something here
end

that works, right? :confused:
but just for fun, is it possible to use emtpy functions? :D

Lorne
12-15-2003, 06:39 PM
Originally posted by SonG0han
seems its not really important to use an emtpy function cause with the if statement i can do "nothing" if it fails, right?

example:
if (bla == "") then

else
-- do something here
end

that works, right? :confused:

Yep.

but just for fun, is it possible to use emtpy functions? :D

Yep. :)

Worm
12-15-2003, 09:38 PM
The non productive code seems cofusing to me.

Why not use a not equals instead?

if (bla ~= "") then
-- do something here
end

Corey
12-15-2003, 09:55 PM
Here, I've refined it even further, technically this is legal code:

if a then
end

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

SonG0han
12-16-2003, 05:09 AM
right worm, thats better ;)

TJ_Tigger
12-16-2003, 10:05 AM
What a great brainstorming community.

Watch out so you don't shock your self.