Oxygen Basic
Programming => Example Code => Topic started by: Peter on February 21, 2013, 01:54:23 PM
-
deleted
-
Hope is still alive.
Thank You!
-
I only have one word of advice.
BACKUP
-
Peter,
I was wondering if Simple Windows can load an animated .gif and let it do its thing without having to be maintained by the event loop?
John
NO, I'm not turning into a gamer. ;)
-
scribaw doesn't work with DYC.
I regenerated a new version of ScriptBasic for Windows without the manifest. (scribaw2k.exe) It works with IUP applications using the ScriptBasic extension module but exception errors running SokoMouse via DYC. Just use scriba.exe from the console to run the game for now.
I attached the IUP Online Dictionary example as a .exe with both scribaw.exe (dictman.exe) and scribaw2k.exe (dictw2k.exe). Neither of these examples pop a console window when run. Charles has been playing with DYC and maybe he knows why certain API calls cause SB to fail.
X
-
Hope is still alive.
Bstring/Zstring conversions now working:
They are sent and received as long values
DLLC
mysbstring = dllzstr (mybstring)
mybstring = dllostring ( mysbstring)
I find this interesting. This is the only way I can pass a string variable to SW. I can not assign that variable anything other than a quoted string or pass it a quoted string or it exception errors.
BmpText fo, 520, 420, Nums[lev], 24, 24
Peter,
I was so wrapped up in performance that I didn't even notice the program was consuming memory at a fairly rapid rate. What do I need to free in each iteration of the event loop to stop the leaking?
-
Hi John
When a function returns a Bstring it is the callers responsibility to dispose of it.
Using DLLC When you receive a Bstring then convert it to an SB string, the Bstring will be freed automatically.
I will also add another function to DLLC for explicitly freeing Bstrings
mybstring=dllostr("ABCDEF")
dlldelo(mybstring)
-
When a function returns a Bstring it is the callers responsibility to dispose of it.
The SokoMouse game isn't calling any Simple Windows functions that return strings. I only pass quoted strings to the library. (only during init)
Glad to hear that DLLC has good house keeping habits.
@Peter
Just to make sure SB doesn't have leaking issues, I ran this at full bore for 5 minutes (100% CPU) and the memory usage level never budged.
SUB me
FOR x = 1 to 1000
b = x
NEXT
END SUB
a = 1
WHILE a
me
WEND
-
Memory leaks?
Do you have an example what shows me what you do?
Just run the SokoMouse game in SB (maybe O2 as well) with task manager and watch the memory keep climbing.
-
I don't see any problem with memory to,only processor is on 100%
-
I think its a bstring interfacing problem with DYC
-
I would have to agree. As I removed Simple Windows functions in an effort to isolate what function might be causing the issue, the memory usage reduced as the functions ceased to be called. I thought it was only functions that passed stings back to SB would cause leaks but it seems passing strings (quoted) to SW without the underline support from O2 for cleanup is the problem. I'll give SW another look after DLLC is introduced.