Is it possible to test functions in gambas console?
Posted
#1
(In Topic #1268)
Regular

I tried an got "Unknow symbol"
Posted
Guru

Posted
Regular

I want to test a brand new function in console without having to run a program.
Lets suppose a function with a string as argument, Visual Basic (if I am not wrong) allowed to do in console:
? newfunction("test string")
and see the result in console. I think gambas doesn't have this feature.
Posted
Regular

So it wold be of little use generally.
What cogier said is how "it is done here".
Posted
Regular

cogier said
If I understand this correctly, you could type the word Stop just after any Dim statements in your function. Run the program in the IDE. The program will stop when it gets to the Stop command. You can use the [F8] key to step through each command to see exactly what's happening. Gambas will display the error when it arrises.
Posted
Regular

thatbruce said
The function would have to be entirely atomic and could not rely on anything that had occurred before in the program, especially instantiation of any object involved.
So it wold be of little use generally.
What cogier said is how "it is done here".
You both are right. In gambas the functions are glued with the form/Module and the only way to test it is to run and breakpoint to allow a console testing. Just did it and worked fine. :geek:
1 guest and 0 members have just viewed this.


