|
Post by votan on Feb 10, 2009 7:25:52 GMT -5
Do you think it would be possible to add a feature that alows RB to treat different .bas files as one file? So like a virtual merge function only merging the files in memory when needed?. Would be a good alternative to the run command... and would work without passing variables from one file to another... For example: file1.bas a$ = "Hello world!" file2.bas print a$ file3.bas (the file that actually gets called) vmerge file1.bas print "A$ contains: " vmerge file2.bas end So the output, when running file3.bas would be: A$ contains: Hello world! So after calling file3.bas, RB includes the 2 other files prior to interpreting it. RB then treats these files like one single .bas file. This would be a great feature in cases like where you have to maintain and use lare language files or different templates on high traffic servers. Using a DB or reading everything from a file or even putting it all into arrays or using the run command would be to demanding at some point. And it would be far easier than all other possible methods.
|
|
|
Post by kokenge on Feb 10, 2009 8:00:10 GMT -5
I agree.. I never want to go back to a language like PHP. But the "INCLUDE" feature is something I really miss and would really help.
|
|
|
Post by Carl Gundel - admin on Feb 10, 2009 12:41:59 GMT -5
I am personally not fond of include-like facilities, but I am willing to consider it.
Perhaps something like:
inline "myfile.bas" -Carl
|
|
|
Post by votan on Feb 11, 2009 5:57:11 GMT -5
You name it, we take it! ;D So, inline is the name for that new function then ..... It would really make some things a lot easier to handle. I'm sure some of us here would really appreciate having a function in RB that works similar to the PHP include. And calling it "inline" might help you to not hate it to much!? .... and others to not accidently compare the great RB with PHP!
|
|
|
Post by Carl Gundel - admin on Feb 11, 2009 7:55:02 GMT -5
You name it, we take it! ;D So, inline is the name for that new function then ..... It would really make some things a lot easier to handle. I'm sure some of us here would really appreciate having a function in RB that works similar to the PHP include. And calling it "inline" might help you to not hate it to much!? .... and others to not accidently compare the great RB with PHP! I called it inline because that what it does. The word include isn't as clear about where the compiled code lives. Personally I think the RUN statement is better. -Carl
|
|
|
Post by votan on Feb 11, 2009 10:01:27 GMT -5
Well, as for things like language-files, templates or other commonly used/shared data that contain lot's of strings or misc needed things, using RUN would be very hard to use. Cause requesting, fetching and returning all the strings via RUN (like for example in language files) would blow up the code tremendously... When using INLINE, all the stuff would be accessible by default, without the need of adding extra code to lookup anyting and without nasty diskactivty whenever something is needed from within that file.
|
|
|
Post by Carl Gundel - admin on Feb 11, 2009 11:51:11 GMT -5
Well, as for things like language-files, templates or other commonly used/shared data that contain lot's of strings or misc needed things, using RUN would be very hard to use. Cause requesting, fetching and returning all the strings via RUN (like for example in language files) would blow up the code tremendously... When using INLINE, all the stuff would be accessible by default, without the need of adding extra code to lookup anyting and without nasty diskactivty whenever something is needed from within that file. Sure, I can appreciate that. -Carl
|
|
|
Post by StefanPendl on Feb 12, 2009 2:12:17 GMT -5
Well, as for things like language-files, ... Cause requesting, fetching and returning all the strings via RUN (like for example in language files) would blow up the code tremendously... ..., without the need of adding extra code to lookup anyting and without nasty diskactivty whenever something is needed from within that file. Don't you think it is easy to read a sequential file containing lines like: English.lng OR German.lng These must be read only once at the beginning of your program.
|
|
|
Post by votan on Feb 12, 2009 5:11:05 GMT -5
Using sequential files would work for smaller projects or when using seperate language files for each seperate section of a project. Cause if I understand sequntial files right, each record must be processed in turn. And If you want to process a particular record, you must read every record in the file in turn until you get to the one you want. So sequential files only make sense when you want to process most (or all) of the records in a file every time you run your program. So in some situations using sequential files is the right way.. but for other situation the "INLINE" function would be far better. My situation always it..... lots of users accessing the same sections.... so there will be lots of sequential file access then.... and always parsing the whole (large) files. In that case it would even make more sense to use a fast database..... but that all will start to slow down things tremendously fast. The "INLINE" function would provide a way faster and more usable solution without any unneeded disk activity or CPU usage.
|
|
|
Post by kokenge on Feb 18, 2009 12:06:49 GMT -5
Sorry for responding this late. Been on vacation for a few weeks.
My question is - will the INLINE statement ever happen.
I need to know, because if it is going to be part of Run Basic, I'll be willing to wait and then convert many of the programs I have using the RUN statement to the INLINE statement.
Is the probability hi, lo or never..
|
|
|
Post by Carl Gundel - admin on Feb 18, 2009 13:13:11 GMT -5
I'm going to put it in for the next release.
-Carl
|
|