Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Function Instr, faulty response since version 2.0.8.2

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Zitronenfalter

Bascom Member



Joined: 23 Aug 2010
Posts: 2

austria.gif
PostPosted: Wed Aug 21, 2019 10:36 am    Post subject: Function Instr, faulty response since version 2.0.8.2 Reply with quote

Hello

The Function Instr in Version 2.0.8.2 shows an incorrect result if the search string is embedded within {} (e.g. "{034}" for the quotation mark).
Code:
$regfile = "m48def.dat"                                    
$crystal = 4000000                                        
$baud = 19200                                              
$hwstack = 32                                              
$swstack = 10                                              
$framesize = 40                                            

Dim String1 As String * 20
Dim String2 As String * 1
Dim Found As Byte

String1 = "abcdefghijklmno"
String2 = "g"

Found = Instr(1 , String1 , String2)
' Result:
' Found (2081) = 7
' Found (2082) = 7

Found = Instr(1 , String1 , "g")
' Result:
' Found (2081) = 7
' Found (2082) = 7

Found = Instr(1 , String1 , "{103}") ' Chr(103 = "g"
' Result:
' Found (2081) = 7
' Found (2082) = 0

 


(BASCOM-AVR version : 2.0.8.2 )
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4799
Location: Holland

blank.gif
PostPosted: Wed Aug 21, 2019 12:22 pm    Post subject: Reply with quote

i tested and confirm it is a bug. will have a look at it.
_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum