1. include on the fly?

Hi there, 
I want to write a program that can include a file on the fly
something like this:

s=prompt_string("What is the file to run?")
include s

This should work in the interpreted mode, but of course not
in the compiled mode. The interpreter should just keep on
doing its thing with the newly included file.

But he returns the error "s not found". The include command
apparently only works for literal strings, not varables.

I'm probably coming at it from the wrong direction, but it
seems to make sense to me.
Any suggestions?
JOHN

new topic     » topic index » view message » categorize

2. Re: include on the fly?

----- Original Message ----- 
From: John McAdam <johnmcadam at clix.pt>
Subject: include on the fly?


> 
> Hi there, 
> I want to write a program that can include a file on the fly
> something like this:
> 
> s=prompt_string("What is the file to run?")
> include s
> 
> This should work in the interpreted mode, but of course not
> in the compiled mode. The interpreter should just keep on
> doing its thing with the newly included file.
> 
> But he returns the error "s not found". The include command
> apparently only works for literal strings, not varables.
> 
> I'm probably coming at it from the wrong direction, but it
> seems to make sense to me.

Your observation is correct, it only works on 'literal' strings.
You might try something like: (pseudo code follows)

copy file s => "IncludeMe.e"
include IncludeMe.e

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu