Chr$() function

birre
Member Posts: 22
Hi,
For my serial communication I need to translate a VB6 project to NAV.
This is the code:
Now I can't seem to find what alternative NAV uses for the Chr$ function.
Thank you
For my serial communication I need to translate a VB6 project to NAV.
This is the code:
begin = Chr$(0) + Chr$(1) + Chr$(adr) + Chr$(3) + Chr$(&HC0) + "001" + Chr$(&HE2) + Chr$(&HC1) + Chr$(&HC0) zend = begin + tmp2 + Chr$(4) ck = 0 For i = 1 To Len(send) ck = ck Xor Asc(Mid$(send, i, 1)) Next i send = send+ Chr$(ck) Winsock.SendData send
Now I can't seem to find what alternative NAV uses for the Chr$ function.
Thank you
0
Comments
-
-
Apparantly some text has lost.
I use local variable Chars to define the numbers:
Chr0 := 0; //Chr$(0)
Chr1 := 1; //Chr$(1)
I convert the hexadecimal values and put them to chars:
ChrHC0 := 192; //Chr$(&HC0)
Then I concatenate the different Chars.
The problem is within the checksum:ck = 0 For i = 1 To Len(send) ck = ck Xor Asc(Mid$(send, i, 1)) Next i send = send+ Chr$(ck)
Can I perform a XOR for the ASC value of the SUBSTR?0 -
Why are you doing this? Why not just leave the code in VB and call it from Navision?David Singleton0
-
It has to be integrated in Navision, no other choise available i'm afraid.0
-
The main problem is that the NAV function XOR can only be used on booleans, not on integers like in other languages. You'll have to find some way to make a function that does the same. small tip regarding your MID$ function, you can get the nth character of a test variable by using textvar[n].0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions