I changed it to
[code=thinbasic] If thinBasic_CheckOpenParens() Then
thinBasic_ParseNumber (ByVal hInstance)
If thinBasic_CheckCloseParens() Then
[/code]
now it compiles but I'm not sure if this is the right way to do it.
Hi Eros,
I have this function:
[code=thinbasic] '----------------------------------------------------------------------------
Function TBDI_Init() As Long
' Initialize DirectInput.
' Usage: retval = TBDI_Init( hInstance AS LONG)
'----------------------------------------------------------------------------
Local hInstance As Long
If thinBasic_CheckOpenParens() Then
thinBasic_VariableParseAndGetInfo hInstance
If thinBasic_CheckCloseParens() Then
[/code]
The powerbasic compiler complains about type mismatch with the line that parses the hinstance parameter. So my question is, which parse function do I have to use?
I changed it to
[code=thinbasic] If thinBasic_CheckOpenParens() Then
thinBasic_ParseNumber (ByVal hInstance)
If thinBasic_CheckCloseParens() Then
[/code]
now it compiles but I'm not sure if this is the right way to do it.
Mike,
all numeric interface functions work with EXT data type.
So ou need to declare an EXT variable, parse it and than assign to a LONG or whatever variable.
Examle
[code=thinbasic]DIM eInstance as ext
dim lInstance as long
...
If thinBasic_CheckOpenParens() Then
thinBasic_ParseNumber eInstaìnce
If thinBasic_CheckCloseParens() Then
lInstance = eInstance
'...
'...do what you need here
'...
end if
end if[/code]
Many times the assignement is not necessary if using API functions because most of the time numeric values are passed BYVAL
Sorry, very busy day at work. I will have more time when back home this night. Feel free to send me any mail or post any message.
If you have to parse just one variable you can also use thinBasic_Parse1NumberAndParens function
[code=thinbasic]
eInstance = thinBasic_Parse1NumberAndParens
[/code]
It will automatically check if parens or not. It is also faster.
Ciao
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Thanks and No problem Eros.
I think it is fast approaching time I go buy a rumble game pad, the game device input is coming alive!!
Which comes to any recommendations? I used to have a cheap generic gamepad, I know you can buy an Xbox controller for the computer, would that be better, does that have rumble? Any other ones you guys used that you liked?
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Wait Kent till I got effects in. First it will be just axxis and buttons.
It is great Mike is working on it now!
I can't wait for first release...
Bye,
Petr
P.S. kryton, I have no idea what do you mean by generic gamepad I have all the controlers at home by Logitech ( good / bad ? ) and in my opinion it is very good and durable stuff. But I had no oportunity to try controlers from othere designers.
No one of the devices has force feedback, I thought not so many games support it so I avoided it . Well, things are changing fast
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
It would be neat to have a rumble only when our ship is hit, this way you know you are getting damage and maybe can help to learn how to avoid enemy attack blasts better. It would also be neat when you dock to get that connection feel to the station or other ships. Or picking up a pick up.
I have a logitech joystick that I use now, but I think for this cool game a rumble game pad might be more of the perfect input device
No rush Mike, I just wanted to say how happy I am you are working on this making such progress!!
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Bookmarks