OK, you are right.
I will change to something else.
Printable View
OK, you are right.
I will change to something else.
Updated above post with a new Core.
Now it implements RAWTEXT/END RAWTEXT.
Thanks Eros,
I have just been testing RAWTEXT. It seems to parse the string taking out comments also turning the whole string, except for quoted content, into upper case. Would it be possible to capture the unprocessed content before it goes through any of the main parsing procedures?
I am also playing with the thinCore.BI file and the DEF / dlltool batch file file you kindly sent earlier. I seem to be calling this function successfully but it does not want to return a variable pointer (null). Do I need to give the variable name in uppercase. Are there any decorations to add to the varname?
This is my intepretation of thinBasic_VariableGetInfo
PS Corrected BSTR ptr to BSTR: variable attribs now visible.
FreeBasic
[code=thinbasic]
' '----------------------------------------------------------------------------
' 'thinBasic_VariableGetInfo
' '----------------------------------------------------------------------------
' ' Returns additional variable info giving variable name.
' ' ATTENTION: pass variable as reference. Function will populate
' ' with relevant information
' ' Function will return a pointer to variable data that can be used in other
' ' situations.
' '----------------------------------------------------------------------------
DECLARE FUNCTION thinBasic_VariableGetInfo _
LIB "thinCore.DLL" _
ALIAS "thinBasic_VariableGetInfo" _
( _
Byval SearchKey AS BSTR , _
Byval pMainType As Long Ptr , _ '---ATTENTION: parameter passed BYREF will return info
Byval pSubType As Long Ptr , _ '---ATTENTION: parameter passed BYREF will return info
Byval pIsArray As Long Ptr _ '---ATTENTION: parameter passed BYREF will return info
) As Long
'---Equates for variable Main Type
Const MainType_IsNumber As Long = 20
Const MainType_String As Long = 30
Const MainType_Variant As Long = 50
Const MainType_UDT As Long = 60
'---Equates for variable Sub Type
Const SubType_Byte As Long = 1
Const SubType_Integer As Long = 2
Const SubType_Word As Long = 3
Const SubType_DWord As Long = 4
Const SubType_Long As Long = 5
Const SubType_Quad As Long = 6
Const SubType_Single As Long = 7
Const SubType_Double As Long = 8
Const SubType_Currency As Long = 9
Const SubType_Ext As Long = 10
Const SubType_AsciiZ As Long = 15
[/code]
Well I've made a little more progress - can now read the Variable attributes and get a variable pointer but cant see the contents of an initialised variable eg an integer value yet. Maybe it's bed time..
This is the test function I am using to look at the thinBasic LONG variable:
still getting 0 instead of the initialised value 42.
PS: Corrected code with thinBasic_DirectPtrToDataPtr: Now working!
[code=thbasic]
Function GetvarPtr(VarName as string) as long
dim as PBStringDescriptor pbsd
dim as long MainType , SubType, IsArray
pbsd.bstr=SysAllocStringByteLen( strptr(VarName), Len(VarName) )
'pbsd.other=0
dim as long i,j
i=thinBasic_VariableGetInfo (pbsd.bstr, @MainType, @SubType, @IsArray )
if i then
j=thinBasic_DirectPtrToDataPtr(i)
if j then
'MessageBox 0,str$(peek(long,i))+" "+str$(MainType)+" "+str$(SUbType)+" "+str$(IsArray),"test",0
MessageBox 0,VarName+" "+str$(peek(long,j))+" "+str$(i)+" "+str$(j),"vars",0
end if
end if
SysFreeString pbsd.bstr
function=i
end function
[/code]
Hi Charles,
I will work on ROWTEXT in order to fix case and other stuff.
Regarding thinBasic_VariableGetInfo interface function, the returned pointer is not the a pointer to variable data but a pointerr to a structure holding the variable info.
As I said before, I need to develop a new specific function for you.
In the meantime, to get variable data pointer you can use "thinBasic_DirectPtrToDataPtr(BYVAL DirectPtr AS LONG)" function passing the value returned by "thinBasic_VariableGetInfo".
Eros
Charles,
I've updated zip file in previous post: http://community.thinbasic.com/index...11611#msg11611
I've added interface function "thinBasic_VariableGetInfoEX". See thinCore.inc file for declaration. "DataPtr" parameter is the direct pointer to variable data. I can implement more if needed.
Ciao
Eros
Thank you Eros, I have incorporated the new function in thinCore.BI and thinCore.DEF and tested out the new thinCore. We are nearly there :)
Can we retain the comments in the RAWTEXT. These are still being stripped out. Some scripts will inevitably want to use the single quote mark for other purposes.
OK, perfect.
I will not be so fast to chage ROWTEXT behave because I have to change the script pre-parsing process. I need some more time, sorry.
In the meantime I hope you can continue your O2 dev using double quoted string.
Ciao
Eros
That is no problem for Oxygen or the Assembler since they both use BASIC style comments. Though for debugging purposes it is still desirable to have the comments there eventually.
I am making a list of issues relating to the Freebasic interface. For instance multidimensional arrays are row major in contrast to PB column major order. Nothing that needs immediate attention.
One thing I spotted: the Asciiz subtype returns 25 but the equate in both the INC and BI files shows it as 15