Static array dimensioning + using apostrophes
Posted: Thu Oct 11, 2012 11:37 pm
rudd68 wrote:This code works fine for the increment of a large number as string:Please insert in the documentation the static array dimensioning with zero [0] and give the note that there is no index overflow.Code: Select all
Structure char c.c[0] EndStructure Procedure.s Inkrementieren(Zahl.s) Protected *char.char = @Zahl Protected Pos.i = Len(Zahl) - 1 While Pos >= 0 If *char\c[Pos] = '9' *char\c[Pos] = '0' Else *char\c[Pos] + 1 ProcedureReturn Zahl EndIf Pos - 1 Wend ProcedureReturn "1" + Zahl EndProcedure Define Zahl.s Define i.i For i = 1 To 20 Zahl = Inkrementieren(Zahl) Debug Zahl Next
The apostrophes are only written in the "Strings - Asc" section. But the apostrophes converts a constant char to the ascii value, its appearance resembles an operator more than a function. Apostrophes should also be mentioned in the "Operators" section.
Apostrophes are a valid notation. They should also be mentioned in the "Syntax" section.
Thank you.