Yes it's because ReDim(Size) creates Size+1 elements. You could ReDim with Size-1 in the end or do the first ReDim only in the second iteration of the ForEach loop:
Define j.JSON, Size.i
Size = ArraySize(j\Test$())
ForEach Names$()
If ListIndex(Names$()) > 0
Size + 1
ReDim j\Test$(Size)
EndIf ...
Search found 67 matches
- Thu Apr 24, 2025 8:58 pm
- Forum: Coding Questions
- Topic: How to avoid empty array elements when making JSON out of structures?
- Replies: 3
- Views: 637
- Fri Apr 18, 2025 8:18 am
- Forum: Tricks 'n' Tips
- Topic: VecVi - Create and output documents using VectorDrawing lib
- Replies: 16
- Views: 8098
Re: VecVi - Create and output documents using VectorDrawing lib
Sorry, but I don't see any IDE config lines in the code or config files in the git repository.
- Sat Mar 29, 2025 4:18 pm
- Forum: Tricks 'n' Tips
- Topic: VecVi - Create and output documents using VectorDrawing lib
- Replies: 16
- Views: 8098
Re: VecVi - Create and output documents using VectorDrawing lib
I configured my IDE to not write any config to files or append it to the code. Is that what you mean?skywalk wrote: Fri Mar 28, 2025 9:53 pm Side note: the git PB files have config info at the bottom of the files AND separate config files. Did you set gitignore on the config files?
- Fri Mar 28, 2025 7:18 pm
- Forum: Tricks 'n' Tips
- Topic: VecVi - Create and output documents using VectorDrawing lib
- Replies: 16
- Views: 8098
Re: VecVi - Create and output documents using VectorDrawing lib
new version 1.20
- added ReplaceHeader(), ReplaceFooter(), AppendHeader(), AppendFooter()
- added variable support with GetVariable(), SetVariable(), RemoveVariable()
- added named position support with GetNamedPos(), SetNamedPos(), UseNamedPos()
- added LoadFile()/SaveFile()
- added pzName ...
- added ReplaceHeader(), ReplaceFooter(), AppendHeader(), AppendFooter()
- added variable support with GetVariable(), SetVariable(), RemoveVariable()
- added named position support with GetNamedPos(), SetNamedPos(), UseNamedPos()
- added LoadFile()/SaveFile()
- added pzName ...
- Tue Mar 11, 2025 7:55 pm
- Forum: Bugs - IDE
- Topic: [Done] Compare Files/Folders - Only first digit of linenumber shown
- Replies: 6
- Views: 3194
Re: Compare Files/Folders - Only first digit of linenumber shown
Works as expected with PB 6.20 on Windows 11.
- Tue Mar 11, 2025 7:50 pm
- Forum: Bugs - IDE
- Topic: [Done] PB_TOOL_Word empty?
- Replies: 5
- Views: 2916
Re: PB_TOOL_Word empty?
Works as expected with PB 6.20 on Windows 11.
- Tue Mar 11, 2025 7:46 pm
- Forum: Bugs - IDE
- Topic: Add/Remove Marker with function key doesn't work.
- Replies: 4
- Views: 2041
Re: Add/Remove Marker with function key doesn't work.
Works normally under Windows, can't test with Linux.
- Tue Mar 11, 2025 7:43 pm
- Forum: Bugs - IDE
- Topic: [Done] Is this a Line Continuation Bug?
- Replies: 6
- Views: 2541
Re: Is this a Line Continuation Bug?
Works for me, too.
- Sat Mar 01, 2025 10:39 pm
- Forum: Coding Questions
- Topic: Printing in PB, Dante's 7 circles of Hell!!!
- Replies: 6
- Views: 667
Re: Printing in PB, Dante's 7 circles of Hell!!!
True, I updated my above code.
- Sat Mar 01, 2025 12:11 pm
- Forum: Coding Questions
- Topic: Printing in PB, Dante's 7 circles of Hell!!!
- Replies: 6
- Views: 667
Re: Printing in PB, Dante's 7 circles of Hell!!!
quick&dirty
Procedure eventPrintHandler()
If Not PrintRequester()
ProcedureReturn
EndIf
If StartPrinting("Test")
iFont = LoadFont(#PB_Any, "Arial", 12)
If IsFont(iFont)
If StartVectorDrawing(PrinterVectorOutput(#PB_Unit_Point))
VectorFont(FontID(iFont), 12)
DrawVectorParagraph ...
Procedure eventPrintHandler()
If Not PrintRequester()
ProcedureReturn
EndIf
If StartPrinting("Test")
iFont = LoadFont(#PB_Any, "Arial", 12)
If IsFont(iFont)
If StartVectorDrawing(PrinterVectorOutput(#PB_Unit_Point))
VectorFont(FontID(iFont), 12)
DrawVectorParagraph ...
- Wed Nov 27, 2024 10:03 am
- Forum: Coding Questions
- Topic: Confusion around macros and variable expansion
- Replies: 8
- Views: 1224
Re: Confusion around macros and variable expansion
no, the macro replaces the parameter by the given expression in the call without expanding it. See the second example in https://www.purebasic.com/documentation ... acros.html
You could try to get the shortcut value by using the runtime library.
You could try to get the shortcut value by using the runtime library.
- Mon Aug 12, 2024 9:16 pm
- Forum: Off Topic
- Topic: Account Outlook.com Hack
- Replies: 12
- Views: 4707
Re: Account Outlook.com Hack
For outlook.com it could be useful to create a secondary alias email address that is not public and then transfer the login privilege only to this address. You can still use your normal email address, but login to the microsoft account then is only possible through the alias.
- Sat May 04, 2024 10:57 pm
- Forum: Coding Questions
- Topic: ? Need Help with Regular Expression
- Replies: 4
- Views: 688
Re: ? Need Help with Regular Expression
Use MatchRegularExpression() instead
- Tue Apr 16, 2024 3:09 pm
- Forum: Coding Questions
- Topic: date format for SetMailAttribute()?
- Replies: 2
- Views: 577
Re: date format for SetMailAttribute()?
I'd say it's the format specified in RFC 5322: https://www.rfc-editor.org/rfc/rfc5322.html#section-3.3, so for example: Sat, 13 Apr 2024 11:45:15 +0200
- Tue Apr 09, 2024 7:05 pm
- Forum: Coding Questions
- Topic: Vector Drawing
- Replies: 6
- Views: 1449
Re: Vector Drawing
StopVectorDrawing() is needed to finish and display the drawing operation, so maybe moving StartVectorDrawing() and StopVectorDrawing() into the loop helps. MouseButton() and the Mouse library are used on screens, better use the event types the CanvasGadget provides for mouse keys.