Re: string_exec()

new topic     » goto parent     » topic index » view thread      » older message » newer message
DerekParnell said...
petelomax said...

An old idea, but I thought it is about time I at least got a start on some design. ...

I've not had much need for this facility (that I can recall), so what would be its purpose? Can anyone give me some useful, concrete examples?

I have used this in Tiggr for over 10 years, and if Ryan builds his spreadsheet app, he'll likely need it as well. I seem to recall a number of people were using includes late in an app's program, so that the app could write the include, and when RDS made that impossible, there was a fuss, so someones were doing a faux string_exec.

DerekParnell said...

<snip>
I think the safest route to go would be to have string_exec() take two parameters - the code text, and a work-space environment that would contain values supplied by the calling app. string_exec() would return two things: A success/failure code and an updated work-space. The calling app could then decide what to do with the updated values.

Your suggestion that the programmer specifically state what vars be in the string_exec context means the programmer must know what vars the string will need, which is a difficult task if you don't know who will enter what string when. Same with stating a new set of includes for the new environment, how will you know what to include?

Which is why i suggested it be converted to IL code or compiled or whatever the wizardry du jour is, and the result inlined (or gosub'd) where it was called. That automatically restricts it to the same scope as the include file and the procedure containing it.

You'd want to filter out dangerous words and phrases like "system_exec(". Or maybe not, it depends on what you want to allow, what your app is to do.

Kat
Forked into: IL Engineering Library

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu