Error with .bas file using GiD15

Moderator: GiD Team

Posts: 1
Joined: Tue Jan 12, 2021 6:00 am

Error with .bas file using GiD15

Postby jingwenh » Tue Jan 12, 2021 6:07 am


I have a problemtype that works fine to generate tcl file with models that I built earlier using GiD13, but it gives an error when I try to generate the tcl file for models built in GiD15. Could you please take a look at it? I have attached the model and the problemtype.

(2.88 MiB) Downloaded 35 times
UWquad2D_Effective_PM4Sand.gid -
(8.12 KiB) Downloaded 34 times
User avatar
Posts: 1699
Joined: Thu Sep 18, 2014 3:31 pm

Re: Error with .bas file using GiD15

Postby escolano » Fri Jan 22, 2021 4:36 pm

I have tested it with GiD 13.0.4 and 13.1.11d and both do the same as current GiD 15
Which exact GiD 13 version is writting the .dat file without errors?

Error in base file 'C:/gid project more/gidusers/Forum/jingwenh/UWquad2D_Effective_PM4Sand.gid/UWquad2D_Effective_PM4Sand.bas' at line number 919: *endif or *end necessary for *if

It seems that there are bugs in the .bas template (some *loop or *if not paired with *end loop and *end if)
Unfortunately is is very difficult to detect the bugs in 1000 lines of code, specially because it is not possible to indent the .bas file or debug it.
The only way is to see what is printed in the .dat until the error is raised

Also edit the .bas file with RamDebugger (Data->Problemtype->Debugger...) can aid sometimes.

Note: ramdebugger can debug the Tcl files, but not the .bas templates

If has a special parser that check the GiD .bas syntax.
open your file and got to ramdebuger menu: Debug->Reinstrument
It raise some errors.

You can double-click the asterisc * of *if *loop, etc and it will select in green its block.
e.g. If I click the lines 85 and 112
*loop nodes
It show an error that ist *end nodes doesn't exists and maybe *loop nodes must be deleted?

and the line
seems that also is not closed by an *end if, add it in the appropliated place (I don't know what must be writeen in the file)

After these 3 chages, at least Ramdebugger is not complaing of unpaired commands, and I am able to export a calculation file without errors.
This is my modified file:
(5.63 KiB) Downloaded 24 times

Note: the modern problemtypes don't use .bas templates, they write the calculating files with Tcl procedures, that is a scripting language much more powerful than these simple templates.

Return to “Customization”

Who is online

Users browsing this forum: No registered users and 1 guest