1. Enter procedures externally
- Posted by Christopher B <president at insight-concepts.com> May 25, 2002
- 433 views
I have another tricky problem I hope you guys can help out with. I have a program I want the user to be able to enter procedures= in an EditText box, and have my program carry out the procedure= internally. Example: procedure example() openWindow(exampleWin,Modal) end procedure Now when the user enters example() in the EditText box, the= window opens. Is this possible, if so how? Thanks in advance, Chris
2. Re: Enter procedures externally
- Posted by Martin Stachon <martin.stachon at worldonline.cz> May 25, 2002
- 437 views
Sounds like creating an interpreter, but in this case you can do something like this: sequence s,rid integer at s = "example()" at = find('(', s) s = s[1..at-1] rid = routine_id(s) if rid = -1 then -- error end if call_proc(rid) -- Martin ----- Original Message ----- From: "Christopher B" <president at insight-concepts.com> To: "EUforum" <EUforum at topica.com> Sent: Saturday, May 25, 2002 11:22 AM Subject: Enter procedures externally I have another tricky problem I hope you guys can help out with. I have a program I want the user to be able to enter procedures in an EditText box, and have my program carry out the procedure internally. Example: procedure example() openWindow(exampleWin,Modal) end procedure Now when the user enters example() in the EditText box, the window opens. Is this possible, if so how?
3. Re: Enter procedures externally
- Posted by a.tammer at hetnet.nl May 25, 2002
- 435 views
Give your user a chance to select from a row of numbered items,= take the number, and then in an if elsif etc row test it for the= routine to be performed EUrs antione
4. Re: Enter procedures externally
- Posted by a.tammer at hetnet.nl May 25, 2002
- 451 views
Dobar den, Martino( I don't remeber the correct declination). I guess your method has to fail if 1) Win32lib was included after the location of this function 2) The interpreter will not know which functions to include and might throwout some of those, user might want to enter. Remember the new way include-files are handled? EUrs antoine tammer
5. Re: Enter procedures externally
- Posted by Martin Stachon <martin.stachon at worldonline.cz> May 25, 2002
- 437 views
Goede dag, Antoine, > Dobar den, Martino( I don't remeber the correct declination). Dobry den, Martine, but sure better then my Dutch > I guess your method has to fail if > 1) Win32lib was included after the location of this function > 2) The interpreter will not know which functions to include > and might throwout some of those, user might want to enter. > Remember the new way include-files are handled? Not sure whether I got your point, just what refman says: The routine named by st must be visible, i.e. callable, at the place where routine_id() is used to get the id number. Indirect calls to the routine can appear earlier in the program than the definition of the routine, but the id number can only be obtained in code that comes after the definition of the routine. I don't see why it should fail. But method like this: s = parse(s) if equal(s, "example") then example() elsif ... would be better for security reasons. But the "Execution of strings" theme has been discussed many times on the list. Martin
6. Re: Enter procedures externally
- Posted by a.tammer at hetnet.nl May 25, 2002
- 418 views
It's only 1 word in Dutch, Martine and it has an 'n' in it. I'm rusty on Slavic languages now, it's 6 years I didn't visit= Czechia, and I tend to mix up Czech, Slowak and Polish, sorry= for that. Goedendag would be correct, with capital G or undercast g. I'm= sorry to have to point out that you didn't evaluate the second= reason, you ought to know that the new interpretertrows out= every function, variable or constant it doesnot find as being= used in the files you present it. THIS WILL ONLY INCLUDE NAMED FUNCTIONS, not functions entered= that will be input from a dedicated functionlike the one we are= talking about, BECAUSE the interpreter has no way of knowing= what user is going to enter in the <call-determining>= function!! Antoine
7. Re: Enter procedures externally
- Posted by a.tammer at hetnet.nl May 25, 2002
- 428 views
Ahoy Martine, About establihing routine_id, I agree with your remarks, BUT that= would require the guy who put the question,(sorry X, I cleared= my cluttered mailbox) to establish routine_ids for all functions he"d like his user to= be able to call. In such case my proposed solution will be= faster,I guess, although he would still have to establish routine_ids Antoine
8. Re: Enter procedures externally
- Posted by Martin Stachon <martin.stachon at worldonline.cz> May 26, 2002
- 428 views
This is a multi-part message in MIME format. ------=_NextPart_000_0026_01C204BA.0B915FE0 charset="iso-8859-1" Antoine wrote: > It's only 1 word in Dutch, Martine and it has an 'n' in it. Ok, I'm just aimed with poor knowledge of German :) > I'm rusty on Slavic languages now, it's 6 years I didn't visit Czechia, > and I tend to mix up Czech, Slowak and Polish, sorry for that. That's ok, I know it must be difficult to remeber all the declinations... May I know what were you doing here? > Goedendag would be correct, with capital G or undercast g. I'm sorry to have > to point out that > you didn't evaluate the second reason, you ought to know that the new > interpretertrows out every > function, variable or constant it doesnot find as being used in the files you present it. The interpreter doesn't throw away any functions, only the new 2-pass binder. When it encounters something like routine_id(var) than it removes no routine. I've just tried it with attached code. > THIS WILL ONLY INCLUDE NAMED FUNCTIONS, not functions entered that will be > input from a dedicated > functionlike the one we are talking about, BECAUSE the interpreter has no way > of knowing what > user is going to enter in the <call-determining> function!! If you mean that user supplies a function code at runtime, then yes, this would require an Eu-inside-Eu interpreter (I think there's a one in archives) Martin ------=_NextPart_000_0026_01C204BA.0B915FE0 Content-Type: application/octet-stream; name="test.ex" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="test.ex" include get.e procedure test1() ?1 end procedure procedure test2() ?2 end procedure sequence s integer rid while 1 do s= prompt_string(">") rid=routine_id(s) if rid=-1 then exit end if call_proc(rid, {}) end while ------=_NextPart_000_0026_01C204BA.0B915FE0--
9. Re: Enter procedures externally
- Posted by Christopher B <president at insight-concepts.com> May 26, 2002
- 435 views
Thank you for your help Martin. Best regards, Chris On Sun, 26 May 2002 13:34:22 +0200, Martin Stachon wrote: > >Antoine wrote: >>=A0It's only 1 word in Dutch, Martine and it has an 'n' in it. > >Ok, I'm just aimed with poor knowledge of German :) > >>=A0I'm rusty on Slavic languages now, it's 6 years I didn't= visit >>Czechia, >>=A0and I tend to mix up Czech, Slowak and Polish, sorry for= that. > >That's ok, I know it must be difficult to remeber all the >declinations... >May I know what were you doing here? > >>=A0Goedendag would be correct, with capital G or undercast g.= I'm >>sorry to have to point >out that >>=A0you didn't evaluate the second reason, you ought to know that= the >>new interpretertrows >out every >=A0function, variable or constant it doesnot find as= being >used in the files you >present it. > >The interpreter doesn't throw away any functions, only the new= 2- >pass binder. >When it encounters something like routine_id(var) than it= removes no >routine. I've just tried it with attached code. > >>=A0THIS WILL ONLY INCLUDE NAMED FUNCTIONS, not functions entered= that >>will be input from a >dedicated >>=A0functionlike the one we are talking about, BECAUSE the= interpreter >>has no way of knowing >what >>=A0user is going to enter in the <call-determining>=A0function!! > >If you mean that user supplies a function code at runtime, then= yes, >this would require >an Eu-inside-Eu interpreter (I think there's a one in archives) > >=A0=A0Martin > > > > --