Hi,
Please help with this code. It does not compile and throws this Error: Pointer mismatch: Cannot handle variable construct. Please check syntax...
'''GCBASIC Program.'''--------------------------------------------------------------------------------------------------------------------------------'''Description: [todo]''''''@author [todo]'''@licenceGPL'''@version [todo]'''@date[todo]'''********************************************************************************#chip mega328p , 16'''-----Includes'''----- Configuration'''-----DefineHardwaresettings'USART settings for USART1#define USART_BAUD_RATE 9600#define USART_TX_BLOCKING'''-----VariablesDimMLASLongDIMPulseasLongDIMLongVarasLongDimTextasString'''----- Interrupts'''-----MainbodyofprogramDoHSerGetStringText' Get Number from usart 1 HserPrint Text 'SendoutTEXTTOusart1HSerSend(13)' Send New Line TO usart 1 LongVar = Val32(Text) 'Error:Pointermismatch:Cannothandlevariableconstruct.LongVar=StringToLong(Text)'Error: Pointer mismatch: Cannot handle variable construct. HserPrint LongVar 'sendoutusart1HSerSend(13)wait100msloop'''----- Subroutines Function Pulses_To_Ml (Pulses as Long) ML = (Pulses * 1000) / 45454 end function'''----- Lookup Tables
I don't know why it does not work.
Regards
Andye
~~~
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you Anobium. The problem is fixed.
Here is my working code example:
#chip mega328p , 16 ' Arduino UNO Board
'''----- Includes
'''----- Configuration
'''----- Define Hardware settings
'USART settings for USART1
#define USART_BAUD_RATE 9600
#define USART_TX_BLOCKING
'''----- Variables
Dim ML AS Long ' Ml Mili-Liters
DIM Pulses as Long ' Ammount of Pulses Oil-Pump
Dim Text as String ' Temp Variable
'''----- Interrupts
'''----- Main body of program
Do
HSerGetString Text ' Get Pulses Number from usart 1
Hserprint "Input = "
HserPrintStringCRLF Text ' Send out Pulses Number TO usart 1
Pulses = Val32(Text) ' Convert Text to LONG Variable
HserPrint "Result = "
HserPrint Pulses_To_mL (Pulses) ' Output Result to usart 1
HserPrintStringCRLF " mL"
wait 100 ms
loop
'''----- Subroutines
' Vevor Diesel Heater Pulse Pump: 1000 Pulses = 22mL heating oil:
' Examples 50000 Pulses = 1,1 L
' 909080 Pulses = 20 L
' 454540 Pulses = 10 L
' 45454 Pulses = 1 L
' 227270 Pulses = 5 L
Function Pulses_To_mL (Pulses as Long) as long
Pulses_To_mL = (Pulses * 1000) / 45454
end function
Hi,
Please help with this code. It does not compile and throws this Error:
Pointer mismatch: Cannot handle variable construct. Please check syntax...
I don't know why it does not work.
Regards
Andye
~~~
My error. Sorry, introduced on 26062024 by me on change 1648.
I add a string constraint to the function.
You can correct, test and let know the result is good.
Edit gcbasic\include\lowlevel\string.h line 403 change
from
to remove the string constraint.
Looking on the bright side.. the error message meant something to me... Sorry.
Thank you Anobium. The problem is fixed.
Here is my working code example:
Excellent! Thanks for reporting back!
I will release the fix.