PDA

View Full Version : Dialog Problems


rctshine
03-22-2005, 03:57 PM
I was doing something for my cousin, Amber, an di wanted to put in this popup. but when I run the program in "program.exe" /AMBER, nothing happens. Am I missing something? The program initializes, but then nothing happens.

Here is the code I put in the Global Functions:

bamberMode = false;
local nNumArgs = Table.Count(_CommandLineArgs);
if(nNumArgs > 0)then
for i,strArg in _CommandLineArgs do
if(strArg == "/AMBER")then
bamberMode = true;
end
end
end

if(bamberMode)then
amberclick = Dialog.Message("Hello Amber", "Hi amber. How are you? do like this. hehehe", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
if(amberclick == IDOK)then
Application.ExitScript();
end
end



Thanks for any help.

Brett
03-22-2005, 04:28 PM
I put your code into an empty SUF70 project's On Startup event. It worked fine when I passed it the /AMBER setting. What version of SUF70 do you have?

Absynthe
03-23-2005, 12:29 PM
Here is the code I put in the Global Functions:
SNIP

Thanks for any help.

Global Functions is used for functions to be called from your code. The code you put there will not run because it is not a function and hasn't been called from any other code.

Paste your code into the startup section like Brett did and it will work fine.

rctshine
03-23-2005, 01:36 PM
Thanks, you were right. Wrong section. hehehe.

Sometimes my stupidity suprises myself. :rolleyes

csd214
03-23-2005, 02:02 PM
The code you put there will not run because it is not a function and hasn't been called from any other code.

To avoid some misunderstanding:
It is possible to have actions in the Global function area. The 'Global actions' are executed BEFORE actions On Startup. You can have local functions wherever you want, but the function must be defined BEFORE it is called. Functions/actions in 'Gloabal' are read by both the setup procedure and the uninstaller.

I think rctshine has used the code in Bret's great Debug script as a template, and the code was placed in the 'Global Functions' area. I copied rctshine's code into Global and it worked as expected. But why do you have the Application.ExitScript() command?

rctshine, I don't see your "stupidity"?

Absynthe
03-24-2005, 08:45 AM
To avoid some misunderstanding:
It is possible to have actions in the Global function area. The 'Global actions' are executed BEFORE actions On Startup. You can have local functions wherever you want, but the function must be defined BEFORE it is called. Functions/actions in 'Gloabal' are read by both the setup procedure and the uninstaller.

I think rctshine has used the code in Bret's great Debug script as a template, and the code was placed in the 'Global Functions' area. I copied rctshine's code into Global and it worked as expected. But why do you have the Application.ExitScript() command?

rctshine, I don't see your "stupidity"?

csd214 is correct, sorry for the misinformation