Search found 1792 matches

by STARGÅTE
Wed Mar 27, 2024 6:42 pm
Forum: Coding Questions
Topic: What is the maximum length a string variable can hold?
Replies: 15
Views: 298

Re: What is the maximum length a string variable can hold?

Nevertheless, even if not enough space is possible to allocate for the string, Space() should not to generate an IMA, but just return an empty string.
by STARGÅTE
Wed Mar 27, 2024 5:28 pm
Forum: Coding Questions
Topic: What is the maximum length a string variable can hold?
Replies: 15
Views: 298

Re: What is the maximum length a string variable can hold?

charvista wrote: Wed Mar 27, 2024 4:50 pm Yes, it is more than 18 billion bytes (billion in American English, it is 18 milliards in French, Dutch, German, Italian,...)...
No, it is unicode, so 18 billion characters need 36 GB RAM, do you have more than 36 GB RAM?
by STARGÅTE
Thu Mar 21, 2024 8:51 am
Forum: Coding Questions
Topic: Icon display messed up
Replies: 11
Views: 335

Re: Icon display messed up

tatanas wrote: Thu Mar 21, 2024 8:24 am I can't put the full code (too big), so here is the function and the call :
Where do I make a mistake ?
The prototype ExtractArbitrarySizeIcon is not defined, #contextMenu1 is not defined and the menu with number #contextMenu1 is not created.
At least you need a window to create a menu.
by STARGÅTE
Tue Mar 19, 2024 10:47 pm
Forum: Coding Questions
Topic: raspberry pi threading problem
Replies: 3
Views: 207

Re: raspberry pi threading problem

I'm new to Linux so I don't really know what I'm doing, but.... I've taken a program that I wrote for windows and trying to make it work in linux. The problem I've run into is that in some threads, I get "Invalid Memory access" and array out of bounds crashes in places that just can't be....
by STARGÅTE
Thu Mar 14, 2024 7:50 pm
Forum: Feature Requests and Wishlists
Topic: case statements can have the same values?
Replies: 17
Views: 526

Re: case statements can have the same values?

Shouldn't the compiler detect this and report it? The compiler can't do this, because in PureBasic it is also possible to use non-constants like variables in Case statements, which are unknown at compile time. Define Case1.i Define Case2.i Define MyCase.i Define I.i RandomSeed(1) For I = 1 To 8 Cas...
by STARGÅTE
Wed Mar 13, 2024 7:04 am
Forum: Feature Requests and Wishlists
Topic: More mapping with index for pads
Replies: 2
Views: 151

Re: More mapping with index for pads

I'm not sure what do you mean.
The left bumper (LB) and right bumper (RB), button, is mapped for example on index 5 and 6, JoystickButton().
The left trigger (LT) and right trigger (RT), axis, is mapped on the Z axis, JoystickAxisZ()
by STARGÅTE
Sun Mar 10, 2024 11:58 am
Forum: Coding Questions
Topic: How to read a point() from catchimage (from datasection) in startdrawing?
Replies: 3
Views: 126

Re: How to read a point() from catchimage (from datasection) in startdrawing?

If you want to load a PNG image, you need UsePNGImageDecoder() If you use CatchImage() with a static constant, it returns already the ImageID, an additional ImageID() is not needed. Alternatively, you can first catch the image, and later use the ImageID: CatchImage(#Image_Schuinestreep, ?schuinestr...
by STARGÅTE
Sun Mar 10, 2024 10:16 am
Forum: Coding Questions
Topic: Crash with PB 6.10 b6 with function PeekS / PeekL
Replies: 22
Views: 730

Re: Crash with PB 6.10 b6 with function PeekS / PeekL

I was using other people's code from these forums and they used PeekL() in them. :? One example is ts-soft's Registry module, which was later updated by HeXOR (https://www.purebasic.fr/english/viewtopic.php?p=488711#p488711). Were they both wrong to use PeekL() in it? It depends on the context of u...
by STARGÅTE
Sun Mar 10, 2024 9:30 am
Forum: Coding Questions
Topic: Crash with PB 6.10 b6 with function PeekS / PeekL
Replies: 22
Views: 730

Re: Crash with PB 6.10 b6 with function PeekS / PeekL

How do we know when we need to change from PeekL() to PeekI() with 6.10? Just to be clear here, this is no change because of PB 6.10. Also in all previous versions of Pure Basic, PeekL() was never the right choice when looking for a memory address. That your application has never crashed before, is...
by STARGÅTE
Fri Mar 08, 2024 10:15 pm
Forum: Coding Questions
Topic: Rotate Sprite around another's midpoint [SOLVED]
Replies: 4
Views: 275

Re: Rotate Sprite around another's midpoint

The math of the rotation looks fine. To return multiple values from a procedure you can use Pointers and additional parameters: Procedure lights(*source.sprite) Protected tempX.f, tempY.f updateXY(*source\lights()\offsetX,*source\lights()\offsetY, *source\rotate, @tempX, @tempY) ; pass pointer of te...
by STARGÅTE
Thu Mar 07, 2024 4:46 pm
Forum: Coding Questions
Topic: ReDim : Array not initialized
Replies: 5
Views: 159

Re: ReDim : Array not initialized

No problem here. The issue could be related to your system. In the first case ReDim frameInValues.u (250000,1949) allocates around 1 GB. If you then resize the array and the memory do not fit at the current position, PureBacis allocates another 1 GB for the new array and copy all data. You need 2 GB...
by STARGÅTE
Thu Mar 07, 2024 11:01 am
Forum: General Discussion
Topic: AddElement() behaviour
Replies: 11
Views: 384

Re: AddElement() behaviour

You joined 2008 to this forum and realized 16 years later that your assumption of the behavior of AddElement was wrong? What did you do for 16 years? (I'm just kidding. :lol:) What is wrong with the same "Add" in AddElement? Why "add" should mean adding an element to the end of t...
by STARGÅTE
Wed Mar 06, 2024 9:13 pm
Forum: Coding Questions
Topic: Slow to compile with 6.10 Beta 7 with C vs ASM
Replies: 12
Views: 580

Re: Slow to compile with 6.10 Beta 7 with C vs ASM

I had the same experience here. One of my largest project has 70k lines. In the ASM backend it complies in 2 s, good time for development. When I switch to C backend (without optimization) it takes 14 s and with optimization 35 s, both not ideal for development. So currently I use only the ASM backe...
by STARGÅTE
Wed Mar 06, 2024 11:09 am
Forum: Bugs - C backend
Topic: [Done] PB 6, C-backend - XOr with pointers
Replies: 2
Views: 195

[Done] PB 6, C-backend - XOr with pointers

XOr comparision with pointers gives a compiler error. No problem in the ASM backend or with Or or And in the C backend Structure Object Value.i EndStructure Structure Definition *ReplacementObject.Object EndStructure Define Object.Object : Object\Value = 123 Define DestinationDefinition.Definition :...
by STARGÅTE
Wed Mar 06, 2024 10:40 am
Forum: Coding Questions
Topic: PB 6.10 Beta 7 - Different output of doubles with Debug
Replies: 2
Views: 134

PB 6.10 Beta 7 - Different output of doubles with Debug

Since PB 6.10 Beta 7 the output of doubles in the debugger has changes, but why? Now, the debugger show roughly 26 precision digits, although doubles can have only 16 digits: Debug #E Debug #PI Debug 0.2 Debug 1e30 Debug 1e-5 Debug 1e-10 2.7182818284590451 3.1415926535897931 0.20000000000000001 1000...