Search found 3721 matches

by Little John
Mon Jan 15, 2024 12:02 am
Forum: Feature Requests and Wishlists
Topic: choose()
Replies: 2
Views: 507

Re: choose()

Code: Select all

Procedure.s RandomChoose (myList$, sep$=",")
   Protected.i last, item
   
   last = CountString(myList$, sep$)
   item = Random(last) + 1
   
   ProcedureReturn StringField(myList$, item, sep$)
EndProcedure


Debug RandomChoose("Hello,World,To,The")
by Little John
Sun Jan 14, 2024 11:50 pm
Forum: Tricks 'n' Tips
Topic: Easter calculation (Gregorian only)
Replies: 2
Views: 724

Re: Easter calculation (Gregorian only)

Easter calculation can be done for the Julian calendar as well as for the Gregorian calendar with version 2.0 of my DateEx module.
by Little John
Sun Jan 14, 2024 11:39 pm
Forum: Tricks 'n' Tips
Topic: DateEx: Extended Date library
Replies: 33
Views: 4509

Re: DateEx: Extended Date library

With version 2.0 of the module, you can now easily convert dates from the Julian calendar to the Gregorian calender and vive versa. For instance, the Orthodox Catholic Church celebrates Christmas on Dezember 25th, according to the Julian calendar. What is the corresponding date in the Gregorian cale...
by Little John
Sun Jan 14, 2024 11:36 pm
Forum: Tricks 'n' Tips
Topic: DateEx: Extended Date library
Replies: 33
Views: 4509

Re: DateEx: Extended Date library

New version 2.00, 2024-01-14 Fixed Bug in Procedure DateDiff() Changed improved error handling cosmetic changes extended and improved comments New Many procedures now have the additional optional parameter 'calendar', so that they can use the Julian calendar even for dates after 1582-10-04. Procedur...
by Little John
Tue Jan 09, 2024 5:10 pm
Forum: General Discussion
Topic: Source too big for the free version
Replies: 31
Views: 2974

Re: Source too big for the free version

Maybe, but then how long until someone complains that's not enough? :? a 1000 lines limitation is sound better , not too big , not too small , and a good number . just few line more than 800 lines Define newLimit, oldLimit = 800 Repeat newLimit = oldLimit + 200 Debug "A limit of " + newLi...
by Little John
Tue Jan 09, 2024 8:32 am
Forum: Coding Questions
Topic: Negative values passed to Chr() generate an error
Replies: 5
Views: 736

Re: Negative values passed to Chr() generate an error

DeanH wrote: Tue Jan 09, 2024 5:43 am Using 6.10 beta 1 and 6.04 LTS, ASM, a negative value passed to Chr() generates an error.
Doing so is an error. So this is no bug.
by Little John
Fri Jan 05, 2024 8:30 am
Forum: Coding Questions
Topic: ExamineDirectory() not displaying all files ?
Replies: 9
Views: 701

Re: ExamineDirectory() not displaying all files ?

lisa_beille wrote: Fri Jan 05, 2024 12:04 am i use pb 6.02 x86 on windows 11 64bits
That's what I suspected. :-)
You have already received a detailed explanation.
by Little John
Thu Jan 04, 2024 9:02 pm
Forum: Coding Questions
Topic: ExamineDirectory() not displaying all files ?
Replies: 9
Views: 701

Re: ExamineDirectory() not displaying all files ?

and how to show hidden files in examineDirectory() then ?? ExamineDirectory() does show hidden directory entries. First step is to use a bit more detailed code snippet: Define.i files, dirs, hf, hd If ExamineDirectory(0, "c:\windows\system32", "*.*") While NextDirectoryEntry(0) ...
by Little John
Mon Jan 01, 2024 4:30 pm
Forum: Off Topic
Topic: Happy New Year 2024 !
Replies: 23
Views: 3041

Re: Happy New Year 2024 !

Happy New Year to all, and once more thanks to the PureBasic team for this great product!
by Little John
Mon Jan 01, 2024 8:34 am
Forum: General Discussion
Topic: Windows quarantines PureBasic
Replies: 8
Views: 1402

Re: Windows quarantines PureBasic

DeanH wrote: Mon Jan 01, 2024 1:20 am ... but may be caused by the large libraries now included in PB compilations.
The problem is mainly caused by poor anti-virus programs. Use an AV program that is less aggressive, e.g. Panda Dome (free).
by Little John
Sun Dec 31, 2023 7:40 pm
Forum: Coding Questions
Topic: Image Size and SAVEIMAGE Problem [Resolved]
Replies: 19
Views: 1203

Re: Image Size and SAVEIMAGE Problem

in orfder to make things not more complicated than necessary, put UsePNGImageEncoder() in the main scope of the program, not in a procedure.
by Little John
Sun Dec 31, 2023 6:13 pm
Forum: Coding Questions
Topic: Image Size and SAVEIMAGE Problem [Resolved]
Replies: 19
Views: 1203

Re: Image Size and SAVEIMAGE Problem

tikidays, wrote:I assumed once at the start of the code was it.
This assumption was/is right: UsePNGImageEncoder() needs only to be called once in a program (normally somewhere at the beginning).
by Little John
Sun Dec 31, 2023 9:18 am
Forum: Coding Questions
Topic: Image Size and SAVEIMAGE Problem [Resolved]
Replies: 19
Views: 1203

Re: Image Size and SAVEIMAGE Problem

@tikidays:
Please don't ask the same coding question in 3 different forum threads. TIA.
by Little John
Fri Dec 29, 2023 9:20 pm
Forum: Tricks 'n' Tips
Topic: DateEx: Extended Date library
Replies: 33
Views: 4509

Re: DateEx: Extended Date library

victorprogra wrote: Fri Dec 29, 2023 7:05 pm Runs Perfect! on macOS (intel)
I'm glad to read that. :-) You are welcome!
Thank you for your kind and detailed feedback!
by Little John
Fri Dec 29, 2023 3:51 pm
Forum: Tricks 'n' Tips
Topic: DateEx: Extended Date library
Replies: 33
Views: 4509

Re: DateEx: Extended Date library

New version 1.30, 2023-12-29 Fixed Bug in Procedure AddDateQ() with #PB_Date_Month Bug in Procedure DateDiff() Changed Procedure Julian2PureDate() now does bounds checking. additional error codes for more precise information cosmetic changes improved some comments New support for Mac OS some additio...