
Is it in the help file?
The only place I could find it mentioned was under the topic of the "Asc()" function. It is a function that operates at compile-time and is used with constants.DoubleDutch wrote:Wow! I didn't know about that using the single quotes automatically converted to the ASCII of the character.
Is it in the help file?
Maybe you are meaning: "\n is line feed not carriage return."?mk-soft wrote:Opps, i have found big bug by "\n" and "\r", "\n" is newline not carrie line
Code: Select all
valuelong.l = $12341FE0
valueword.w = $EEEE
valueinteger.i = $12345
Debug Format("%X", @valueinteger) ; Fehler
Debug Format("%12.8X", @valuelong) ; Breite 12, Type Long
Debug Format("%'#12.8X", @valuelong) ; Auffüllung mit '#' ; Breite 12, Type Long
Debug Format("%4X", @valueword) ; Ohne Breite ist Type ; Type Word
Debug Format("%8X", @valuelong) ; Ohne Breite ist Type ; Type Long
Debug Format("%'#12.4X", @valueword) ; Auffüllung mit '#' ; Breite 12, Type Word
Code: Select all
Select num2
Case 0 To 2 : help = RSet ( Hex ( PeekB ( *value ), #PB_Byte), num2, "0" )
Case 3 To 4 : help = RSet ( Hex ( PeekW ( *value ), #PB_Word), num2, "0" )
Case 5 To 8 : help = RSet ( Hex ( PeekL ( *value ), #PB_Long), num2, "0" )
Default : help = RSet ( Hex ( PeekQ ( *value ), #PB_Quad), num2, "0" )
EndSelect
Code: Select all
Case '%' : result + "%"
Code: Select all
this is a testcode works \%100\%
Code: Select all
Procedure.s FormatQ ( text.s, *value1 = 0, *value2 = 0, *value3 = 0, *value4 = 0, *value5 = 0, *value6 = 0, *value7 = 0, *value8 = 0, *value9 = 0, *value10 = 0, *value11 = 0 )
ReplaceString(text, "'", #DOUBLEQUOTE$, #PB_String_InPlace)
ProcedureReturn Format(text, *value1, *value2, *value3, *value4, *value5, *value6, *value7, *value8, *value9, *value10, *value11)
EndProcedure
Code: Select all
IncludeFile "Format-v207.pbi"
bVal.b = 100
wVal.w = 200
lVal.l = 300
iVal.i = 400
fVal.f = 500.0
dVal.d = 600.0
sVal.s = "Hello World"
aVal.a = 255
uVal.u = 65535
temp.s = "Result: \nByte = %b, \nWord = %w, \nLong = %l, \nInteger = %i, \nFloat = %10.2f, \nDouble = %+10.2d, \n"
temp + "String = %s, \nUnsigned Byte = %a, \nUnsigned Word = %u,\n"
temp + "Hex = %2x, \nHex = %4X\n"
result.s = format(temp, @bVal, @wVal, @lVal, @iVal, @fVal, @dVal, @sVal, @aVal, @uVal, @aVal, @uVal)
MessageRequester("Format like sprintf", result)
Code: Select all
temp.s = "Result: \nByte = %b, \nWord = %w, \nLong = %l, \nInteger = %i, \nFloat = %10.2f, \nDouble = %+10.2d, \n"
temp + "String = %s, \nUnsigned Byte = %a, \nUnsigned Word = %u,\n"
temp + "Hex = %2x, \nHex = %8X\n" ; <--- chaning to 8X