Page 1 of 1

Neoscript

PostPosted: Thu Nov 28, 2013 12:57 am
by HackinHoodLogicsTm
Is there any way to give an action at the end of a prog. To find words and replace them with different word. :P Any answer will appreciated

Re: Neoscript

PostPosted: Thu Nov 28, 2013 7:00 am
by dpayer
HackinHoodLogicsTm wrote:Is there any way to give an action at the end of a prog. To find words and replace them with different word. :P Any answer will appreciated


You have to be more specific. "at the end of a prog" is not a clear term. Do you mean when the app is shutting down? when the user finishes a certain process? when they have reached the last 'page' of your app? when a script from an object (button) has finished?

There is place to put an action when the app is shutting down. Go to BOOK-->BOOK PROPERTIES-->ACTIONS-->SHUTDOWN.

Run a subroutine from there to replace your words.

David P

Re: Neoscript

PostPosted: Thu Nov 28, 2013 7:28 am
by HackinHoodLogicsTm
Hi, i mean if a user inputs a number like 2, is there any script to change the 2 into something else upon giving a filewrite action so that when you open the document you save will not see 2 but something else like 5

Re: Neoscript

PostPosted: Thu Nov 28, 2013 8:47 am
by dpayer
HackinHoodLogicsTm wrote:Hi, i mean if a user inputs a number like 2, is there any script to change the 2 into something else upon giving a filewrite action so that when you open the document you save will not see 2 but something else like 5



Use a conditional statement to test the variable populated from your input. Create a text entry field (var=[TextEntry1]) and a button with the following code:
Code: Select all
If "[TextEntry1]" "=" "2"
AlertBox "Error" "You answered 5. Incorrect!"
SetVar "[TextEntry1]" "5"
Endif
FileWrite "[pubdir]testfile.txt" "All" "[TextEntry1]"
SetVar "[TextEntry1]" ""


You don't need to constantly check to see the value of the variable, only when you need to act on it (after a selection is made and an action ex: button click, has been initiated).

David P.

Re: Neoscript

PostPosted: Thu Nov 28, 2013 8:52 am
by HackinHoodLogicsTm
Thanks for the reply.