Post Reply 
Don't execute a function if a routine is called outside the program
07-03-2015, 06:22 PM
Post: #2
RE: Don't execute a function if a routine is called outside the program
Salvo,

If I understand your question correctly, this should work:

Code:

changedata();
local a:=0;

EXPORT ascendant()
BEGIN
 local ch;
 ch:=msgbox("another calculation?",1);
 if ch<>0 and a==1 then
  changedata();
  a:=0;
 end 
END;

local changedata()
begin
 print();
 print("changedata ran");
end;

export calling_program()
begin
 a:=1;
 ascendant();
end;

When you execute ascendant from the Home screen, changedata is not executed. When calling_program executes ascendant the flag "a" is set to 1 first and changedata is executed. You can't set "a" to 1 externally if you make it local.

I don't know if the prime has user flags like the 48 thru 50g series has or not. I'm still learning HPPPL.

Cheers,

Road
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Don't execute a function if a routine is called outside the program - roadrunner - 07-03-2015 06:22 PM



User(s) browsing this thread: 1 Guest(s)