PDA

View Full Version : TAB Alpha Release 22



catventure
28-02-2007, 15:20
Hi,

Small update: requires latest preview thinBasic 1.2.0.1

28 Feb 2007 (Release 22)
===========
* The "return/enter" key problem in the player input textbox
is now solved! (Thanks Psch)

* #MINVERSION set to 1.2.0.1

* "Press Return To Continue" prompt text not appearing in Input Textbox in 1.2.0.1
Fixed using CONTROL REDRAW command before entering keypress loop (Psch)

http://tab.thinbasic.com/tab.zip

Cheers,
catventure

catventure
28-02-2007, 17:04
I'm getting a "Too Many Nested FOR NEXT" error when playing the text adventure "char_commands_demo" in TAB Player
Seems to occur after asking a character for its inventory when it owns an object...

>say to <character>,inventory

I'm looking for source of trouble.

catventure

catventure
28-02-2007, 19:50
Seems the error is more general than I had anticipated...
It occurs after playing between 20-30 turns of any of the games irrrespective of what commands are typed in.

Still hunting..

catventure

ErosOlmi
28-02-2007, 20:29
Catventure,

from my side I will check deeply in next days on this problem to see if it can be generated by some other bugs inside thinCore.dll

Ciao
Eros

Petr Schreiber
03-03-2007, 00:30
Hi,

this is strange,
I will try to have a look on source tommorow.


Bye,
Petr

ErosOlmi
03-03-2007, 04:09
I tested many FOR/NEXT nested cicles with different EXIT FOR in different positions and all is working so far.
There must be some particular combinations of FOR/NEXT maybe with some IF/THEN or other flow clause not correcly handled by thinBasic parser.

So far I was not able to find errors in script code so it should be in parser.

Still searching ...

kryton9
03-03-2007, 09:57
I played the graphical demo game the other day with no erros, but that is probably a small game compared to the regular ones.
I have a question about these type of games, but will try to find the appropriate place to post it.

But to report, playing the demo game (graphical one), no errors for me.

Petr Schreiber
03-03-2007, 12:13
Hi,

no problem finally here ???
I have latest thinBASIC, latest TAB and I can't make it crash...

Bye,
Petr

catventure
03-03-2007, 13:36
Hi Ken, Psch,

The error occurs after playing around 24 or so turns in a game.
For instance type the command "score" for that many times and the error report will occur..

catventure

ErosOlmi
03-03-2007, 17:58
OK, after more than one hour of debug, I think I've limited the search scope of the problem.

There are some special conditions where due to EXIT DO or EXIT FUNCTION the inner FOR/NEXT nesting counter is not decremented.
There is amaximum of 25 nested FOR/NEXT and for some reasons in special conditions internal nesting counter is incremented but noit decremented when exit a FOR/NEXT cicle.

Problem is inside TAB function called "Parser" or in any function called from inside "Parser".
I'm still searching the exact condition that creates this problem but at least I've limited the search field and the reason why this is happening.

Will continue ...

catventure
03-03-2007, 18:09
Hi Eros,

Thanks for tracing the function where the problem arises. I had eliminated other functions I knew were not causing it... but well done on narrowing it down! :)
I will also check this function "parser" now too to see if it can be pinpointed.

catventure.

ErosOlmi
03-03-2007, 18:18
Checking code, I've found little problem using RANDOMIZE.

Some lines are equal to: RANDOMIZE randnum = RND( 1, 12 )
but it has no meaning other than re-seeding random number generator.

Maybe you wanted to do a "RANDOMIZE" somewhere in the code than call "randnum = RND( 1, 12 )" to assign to randnum a value between 1 and 12

Usually RANDOMIZE has to be called just once at the beginning of a script.

I'm searching again ...

ErosOlmi
03-03-2007, 18:22
Also found something strange in function "processacts"
Looking at coding levels, it seems that at certain point there is a END IF and from that point all code is left alligned to editor edge.
It seems there is an END IF too much.

In any case I'm pretty sure that current NESTING LEVEL runtime error is due to thinBasic parser not handling some special situations.

Searching ...

ErosOlmi
03-03-2007, 18:48
catventure,

I was looking at processacts function and looking the many similar tests present. I was wondering if there is a simple way to get them all in a common structure and I was thinking something like that.

Mainly you assign to any possible command in TAB command line a function in your script. Some of the command have to manage additional parameters but many of them are very similar. So why not try if possible to take advantages of CALL statement?
CALL statement can call a function not known at script time because name of the function to be executed can be composed during script run time. So, for example, if you call all functions related to a command something like "CMD_" followed the command name, for example "CMD_Score", you can get many (if not all) commands with a single line of code like:




if function_exists("CMD_" & checkact) then CALL "CMD_" & checkact



Remember that functions can have optional parameters also.
Example with CALL statement:

dim checkact as string

checkact = "test"

if function_exists("CMD_" & checkact) then call "CMD_" & checkact

function cmd_test() as long
msgbox 0, "OK"
end function

A little variation with optional param

dim checkact as string

checkact = "test"

if function_exists("CMD_" & checkact) then call "CMD_" & checkact()
if function_exists("CMD_" & checkact) then call "CMD_" & checkact("Some additional string")

function cmd_test(optional AdditionalString as string) as long
msgbox 0, "OK and " & iif$(AdditionalString = "", "nothing", AdditionalString )
end function

Just an idea

Going on to find the bug ...

Ciao
Eros

catventure
03-03-2007, 18:49
Agreed, Appears a superfluous "END IF" in processacts function that doesn't match up, so corrected that and reformatted.
I did the RANDOMIZE thing quite some time ago but can be changed if you think better.
Sorry this is such a pain and is taking up so much time.
I still haven't found the "parser" glitch...
catventure.

ErosOlmi
03-03-2007, 18:53
catventure, no sorry at all, please.

If this search will bring us to have a better thinBasic core engine more strong and bug free I will be very, very happy. So, I will have to thanks about that.
It will take a while because TAB is really the biggest thinBasic script I've ever seen but it is something I have and want to do.

Ciao
Eros

catventure
03-03-2007, 19:01
Since I started it in Nov '05 many things have changed in thinBASIC for the better over the various versions with lots of improvements etc.. and I know there are better ways of doing certain things in TAB now than before... I know the code can be shortened in certain areas and better constructed than at present.. and I will be looking at it.
Eg: the new >< relational operator is a wonderful addition and I can see how that alone can be used many times in TAB code lines to shorten many IF conditions and so on...

catventure

ErosOlmi
03-03-2007, 19:05
That's the pro and cons to use a development environment under construction :D But I suppose it have to be that way for every develolment environment.

Yes, I remember when you started with thinBasic and I'm really very happy you are still there.
Choosing a language heavily under construction to develop applications is a brave choice. So thanks again.

Ciao
Eros

catventure
03-03-2007, 19:17
I can honestly say that I have found thinbasic the BEST, easiest and flexible basic language to use for this adventure application project :)
- even earlier when it was in heavy development, I could see the power thinbasic had over some other languages, even at those stages.
Just lately I've been SO pleased that Petr nailed the enterkey thing - it has been a bugbear - and now it is resolved satisfactorily.
I think its great what other members are doing with the 2d and 3d graphic games and tbgl module as well in other projects.

catventure

Michael Hartlef
03-03-2007, 20:08
I can say the same, thinBasic is impresive. I don't care if it is interpreted. It is powerful and the game side just has started to grow more. It will take a while but once we can show more projects to the public and the market thinBasic more, more people will be active on this board.

Petr Schreiber
04-03-2007, 17:15
Hi catventure,

I hope more people will come to use your TAB script.
It is really pleasure to use, all things on place I would expect them.


Petr

kryton9
04-03-2007, 23:56
thinBasic is wonderful in many ways. Besides being the great language you guys mentioned, it brought together a fun group of people and is allowing us to work together in fun ways. I never really looked at text games before. Being a thinBasicer I ran across TAB and the world of text games this way. Who knows what wonders will yet come in this fine forum!!

ErosOlmi
06-03-2007, 09:08
catventure,

I think I've found the bug.
I'm considering to re-code all FOR/NEXT handling in thinCore engine. It is all code created 2 years ago.
So I will not move preview version 1.2.0.1 to stable till FOR/NEXT will be fixed.

Ciao
Eros

catventure
06-03-2007, 18:50
Thanx for info on FOR NEXT situation.
It is really good news maybe it will be fixed in next thinbasic.

catventure

catventure
08-03-2007, 13:58
Eros wrote:



I was looking at processacts function and looking the many similar tests present. I was wondering if there is a simple way to get them all in a common structure and I was thinking something like that.

Mainly you assign to any possible command in TAB command line a function in your script. Some of the command have to manage additional parameters but many of them are very similar. So why not try if possible to take advantages of CALL statement?
CALL statement can call a function not known at script time because name of the function to be executed can be composed during script run time.


This is a very good idea about improving code structure and I can see this optimisation would make processing of input commands faster so I am going to think on this and do some experimentation on your brilliant suggestion along the lines of code you posted.

Thanks for your thoughts on the CALL statement and function params.

catventure