Oxygen Basic
Programming => Problems & Solutions => Topic started by: Aurel on February 07, 2013, 02:51:45 AM
-
Charles...
Do you can confirm that program is closed by simply clicking toolbar button in
AsciEdit example.?
program have a bug ::)
when you click button Save As on start then program is closed.
I simply can't figured why that heapend ???
'save file
Sub doSave
INT hsize=0
dir=""
char tx[32768]
string ext=".o2bas"
filter="All Files (*.*)" + Chr(0) + "*.*" + Chr(0) + "Oxygen Files (*.o2bas)" + Chr(0) + "*.o2bas" + Chr(0)
title="Save File... "
hwnd=0
fName = FileDialog(dir,filter,title,0,1,"o2bas")
fName=fName+ext
'print fname
hsize = SendMessage hsci, SCI_GETTEXTLENGTH, 0, 0
If hsize=0 then return
SendMessage hsci,SCI_GETTEXT,hsize,tx
PutFile fName,tx
Return
End sub
-
Charles..
I just download latest OxygenBasic (inProgress) and try to use oxygen.dll
from this package and..
I have recieve to many errors in my older files.
Is this dll tested ?
-
Grr...i hate this things...
I think that i am find what is wrong...
char tx[32768] cose this troubles.. >:(
so new subroutine look like this:
SUB doSave
INT hsize=0
dir=""
'char tx[32768]
string tx
string ext=".o2bas"
filter="All Files (*.*)" + Chr(0) + "*.*" + Chr(0) + "Oxygen Files (*.o2bas)" + Chr(0) + "*.o2bas" + Chr(0)
title="Save File... "
hwnd=0
fName = FileDialog(dir,filter,title,0,1,"")
fName=fName+ext
print fname
hsize = SendMessage hsci, SCI_GETTEXTLENGTH, 0, 0
If hsize=0 then return
SendMessage hsci,SCI_GETTEXT,hsize,strptr tx
PutFile fName,tx
END SUB
I'm still not sure why extension string is not recognized properly ???
in Save subroutine ,maybe is problem in standard 3 chars instead of .o2bas (5) .
-
Hmm it seems that not work on other ways then using char,but this time I
add char tx[32768] as global variable and looks that work ok... ::)
'save file
SUB doSave
INT hsize=0
dir=""
'char tx[32768]
string ext=".o2bas"
filter="All Files (*.*)" + Chr(0) + "*.*" + Chr(0) + "Oxygen Files (*.o2bas)" + Chr(0) + "*.o2bas" + Chr(0)
title="Save File... "
hwnd=0
fName = FileDialog(dir,filter,title,0,1,"o2bas")
fName=fName+ext
If fName="" then Return
'print fname
hsize = SendMessage hsci, SCI_GETTEXTLENGTH, 0, 0
SendMessage hsci,SCI_GETTEXT,hsize+1,tx
PutFile fName,tx
END SUB