; Linux GetExtensionPart does not recognize file names ending with a backslash.
Filename$="X:\A\A\B\A\B\GTI\A\.tproject"
Debug "GetFilePart:"+GetFilePart(Filename$)
Debug "GetFilePart #PB_FileSystem_NoExtension:"+GetFilePart(Filename$,#PB_FileSystem_NoExtension)
Debug "GetExtensionPart ...
Search found 351 matches
- Mon Jun 03, 2024 9:06 am
- Forum: Bugs - Documentation
- Topic: [Done]GetExtensionPart() of empty filename
- Replies: 17
- Views: 7347
- Wed May 22, 2024 11:06 am
- Forum: Coding Questions
- Topic: [6.10] Always error with C Backend
- Replies: 5
- Views: 1673
Re: [6.10] Always error with C Backend
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04):
Code: Select all
Enter a positive integer: 5
Factorial of 5 = 120k
- Sun May 19, 2024 1:35 pm
- Forum: Coding Questions
- Topic: [Done] Problem with lenght size and PeekS
- Replies: 13
- Views: 2833
[Bug]Re: Problem with lenght size and PeekS
; x86 PeekS IMA with magic length $80FE0, $81FE0, $82FE0, ... , $CDCFEO=13488096, ...
For Length=$81000 To 1 Step -16
Debug Hex(Length)
*MemoryID = AllocateMemory(Length)
For *p.Ascii=*MemoryID To *MemoryID+Length-1
*p\a='A'
Next
s.s=PeekS(*MemoryID, Length, #PB_UTF8)
FreeMemory(*MemoryID ...
For Length=$81000 To 1 Step -16
Debug Hex(Length)
*MemoryID = AllocateMemory(Length)
For *p.Ascii=*MemoryID To *MemoryID+Length-1
*p\a='A'
Next
s.s=PeekS(*MemoryID, Length, #PB_UTF8)
FreeMemory(*MemoryID ...
- Fri May 17, 2024 11:37 am
- Forum: Coding Questions
- Topic: Weird struct sizeof with static arrays
- Replies: 2
- Views: 1637
[no bug]Re: Weird struct sizeof with static arrays
Please note, that in structures a @Bold "static array[]" doesn't behave like the normal BASIC array (defined using @ReferenceLink "Dim" Dim)
to be conform to the C/C++ structure format (to allow direct API structure porting). This means that a@Bold "["2@Bold "]" will
allocate an array from 0 to ...
to be conform to the C/C++ structure format (to allow direct API structure porting). This means that a@Bold "["2@Bold "]" will
allocate an array from 0 to ...
- Thu May 16, 2024 2:37 pm
- Forum: Feature Requests and Wishlists
- Topic: Any 'Skeleton()' example for the manual?
- Replies: 4
- Views: 2110
Re: Any 'Skeleton()' example for the manual?
If the mouse is on the other screen, the skeleton is not visible.
- Tue May 14, 2024 10:58 am
- Forum: Coding Questions
- Topic: Access a USB device from PB?
- Replies: 11
- Views: 2746
- Sun May 12, 2024 12:50 am
- Forum: Coding Questions
- Topic: [SOLVED] ProcedureReturn
- Replies: 4
- Views: 1153
Re: ProcedureReturn
Code: Select all
; If Not Test:ProcedureReturn:EndIf
CMP byte [rsp+48],0
JE No0
XOR rax,rax
JMP Ok0
No0:
MOV rax,1
Ok0:
AND rax,rax
JE _EndIf2
JMP _EndProcedure1
_EndIf2:
Code: Select all
// If Not Test:ProcedureReturn:EndIf
if (!(!(v_test))) { goto no2; }
r=0;
goto end;
no2:;
- Sat May 11, 2024 8:24 am
- Forum: Coding Questions
- Topic: seems like a bug MacroExpandedCount
- Replies: 5
- Views: 1289
[no bug] Re: seems like a bug MacroExpandedCount
--preprocess:
Code: Select all
Macro fry
Debug MacroExpandedCount
EndMacro
x = 0
more:
Debug 1
x+1
If x < 10 :
Goto more :
EndIf
; 1
; 1
; 1
; 1
; 1
; 1
; 1
; 1
; 1
; 1
- Fri May 10, 2024 7:51 pm
- Forum: 3D Programming
- Topic: Problem-question for GetMeshData()
- Replies: 10
- Views: 3651
Re: Problem-question for GetMeshData()
; After GetMeshData ArraySize of vertices is 7. For loop to 60000 stops at vertices(8).
GetMeshData(#malla,0, vertices(),#PB_Mesh_Vertex,0,7)
; ^
Debug "GET ArraySize:"+Str(ArraySize(vertices()))+" #nvertices:"+Str(#nvertices)
;GET ArraySize:7 #nvertices:60000
#nvertices=60000
Dim vertices ...
GetMeshData(#malla,0, vertices(),#PB_Mesh_Vertex,0,7)
; ^
Debug "GET ArraySize:"+Str(ArraySize(vertices()))+" #nvertices:"+Str(#nvertices)
;GET ArraySize:7 #nvertices:60000
#nvertices=60000
Dim vertices ...
- Tue May 07, 2024 1:51 pm
- Forum: Coding Questions
- Topic: Generating digits of PI in Octal
- Replies: 9
- Views: 2410
Re: Generating digits of PI in Octal
PiOctal$="3 ...
- Tue May 07, 2024 7:03 am
- Forum: Feature Requests and Wishlists
- Topic: Debug window switch from time to ElapsedMilliseconds
- Replies: 1
- Views: 800
Re: Debug window switch from time to ElapsedMilliseconds
Does that really make sense?
; File Preferences Debugger Individual Settings Debug Output Add Timestamp set
For i=1 To 10
Debug RSet(Str(ElapsedMilliseconds()%1000),3,"0")+" "+Str(i)
Next
; [07:55:36] 523 1
; [07:55:36] 523 2
; [07:55:36] 523 3
; [07:55:36] 523 4
; [07:55:36] 523 5
; [07:55:36 ...
; File Preferences Debugger Individual Settings Debug Output Add Timestamp set
For i=1 To 10
Debug RSet(Str(ElapsedMilliseconds()%1000),3,"0")+" "+Str(i)
Next
; [07:55:36] 523 1
; [07:55:36] 523 2
; [07:55:36] 523 3
; [07:55:36] 523 4
; [07:55:36] 523 5
; [07:55:36 ...
- Sat May 04, 2024 1:04 pm
- Forum: General Discussion
- Topic: Differences between 6.1 5.73
- Replies: 19
- Views: 4876
Re: Differences between 6.1 5.73
Yes exactly:
Code: Select all
;Value range of Date()
Debug FormatNumber(Date(1601,1,1,0,0,0),0)
Debug FormatNumber(Date(9999,12,31,23,59,59),0)
Debug Hex(Date(1601,1,1,0,0,0),#PB_Quad)
Debug Hex(Date(9999,12,31,23,59,59),#PB_Quad)
; -11,644,473,600
; 253,402,300,799
; FFFFFFFD49EF6F00
; 3AFFF4417F
- Sat May 04, 2024 12:40 pm
- Forum: Coding Questions
- Topic: Suitable fonts for DrawVectorText()?
- Replies: 16
- Views: 3706
Re: Suitable fonts for DrawVectorText()?
If LoadFont has found exactly the right font under Windows, the following lines should appear in test.pdf:
...
8 0 obj
<<
/Type /Font
/BaseFont /HPDFAA+FuturaStd-Book
/Subtype /Type0
/Encoding /Identity-H
/ToUnicode 9 0 R
/DescendantFonts [ 11 0 R ]
>>
endobj
...
Otherwise:
...
8 0 obj
<<
/Type ...
...
8 0 obj
<<
/Type /Font
/BaseFont /HPDFAA+FuturaStd-Book
/Subtype /Type0
/Encoding /Identity-H
/ToUnicode 9 0 R
/DescendantFonts [ 11 0 R ]
>>
endobj
...
Otherwise:
...
8 0 obj
<<
/Type ...
- Sat May 04, 2024 8:51 am
- Forum: General Discussion
- Topic: Differences between 6.1 5.73
- Replies: 19
- Views: 4876
Re: Differences between 6.1 5.73
by boddhi » Thu May 02, 2024 5:22 pm
And some PB functions, like Date(), didn't need .i, only .l, until PB 6.10 regardless 32 or 64-bit OS.
I think that many codes using these functions should no longer work for this reason too.
; Check all Programs with Date() and similar for replacement .l by ...
- Sat May 04, 2024 8:40 am
- Forum: Coding Questions
- Topic: Macro concatenate doesn't work with variable?
- Replies: 3
- Views: 565
Re: Macro concatenate doesn't work with variable?
After adding MyLabel_n: in DataSection the preprocessor "-pp /tmp/a.pp" do Restore MyLabel_n:
Macro DynamicRestore(n)
MyLabel_#n
EndMacro
n=Random(3,1)
Restore MyLabel_n
Read.s label$
Debug label$
End
DataSection
MyLabel_n:
MyLabel_1:
Data.s "MyLabel_1"
MyLabel_2:
Data.s "MyLabel_2 ...
Macro DynamicRestore(n)
MyLabel_#n
EndMacro
n=Random(3,1)
Restore MyLabel_n
Read.s label$
Debug label$
End
DataSection
MyLabel_n:
MyLabel_1:
Data.s "MyLabel_1"
MyLabel_2:
Data.s "MyLabel_2 ...