Search found 20 matches

by rudd68
Sun Aug 19, 2012 11:16 am
Forum: Coding Questions
Topic: 4.61 - wrong error message (NO BUG, sorry)
Replies: 2
Views: 942

Re: 4.61 - wrong error message (NO BUG)

Sorry, that's my fault. It works just fine. :D
by rudd68
Sun Aug 19, 2012 10:54 am
Forum: Coding Questions
Topic: 4.61 - wrong error message (NO BUG, sorry)
Replies: 2
Views: 942

4.61 - wrong error message (NO BUG, sorry)

If I use "Read" in a procedure, the program doesn't work. This is bad.

If I compile this program with the F5 key, then a wrong error message occurs.

; Wrong error message

EnableExplicit

DataSection

Cards: ; each row is a card, -1 ist the end of the cards data

Data.w 825, 0, 0, 225, 0 ...
by rudd68
Wed Aug 10, 2011 8:50 am
Forum: Bugs - Documentation
Topic: PureBasic Docs - Errors & needed improvements to the man
Replies: 223
Views: 370817

Re: PureBasic Docs - Errors & needed improvements to the man

This code works fine for the increment of a large number as string: Structure char
c.c[0]
EndStructure

Procedure.s Inkrementieren(Zahl.s)
Protected *char.char = @Zahl
Protected Pos.i = Len(Zahl) - 1
While Pos >= 0
If *char\c[Pos] = '9'
*char\c[Pos] = '0'
Else
*char\c[Pos] + 1 ...
by rudd68
Sat Aug 06, 2011 4:35 pm
Forum: Coding Questions
Topic: How to convert Hex color to RGB color
Replies: 12
Views: 2583

Re: How to convert Hex color to RGB color

OK, I haven't read exactly enough and misunderstood the problem.
by rudd68
Sat Aug 06, 2011 3:10 pm
Forum: Coding Questions
Topic: How to convert Hex color to RGB color
Replies: 12
Views: 2583

Re: How to convert Hex color to RGB color

@Baldrick: This is wrong.

color = val("$ABCDEF") has the format: BBGGRR, but you use the format RRGGBB.

See here:

mycolor$ = "$FFEEDD" ; Format: BBGGRR, RR(Red) = DD, GG(Green) = EE, BB(Blue) = FF
mycolor = Val(mycolor$)
Debug "my decimal number is : "+Str(mycolor)+" or as hex : "+Hex(mycolor ...
by rudd68
Wed Jul 21, 2010 8:58 pm
Forum: Coding Questions
Topic: SHARED doesn't share variables from the non-main-scope
Replies: 15
Views: 3503

Re: SHARED doesn't work in sub-procedures

OK, how can I change the topic title?
by rudd68
Wed Jul 21, 2010 7:04 pm
Forum: Coding Questions
Topic: SHARED doesn't share variables from the non-main-scope
Replies: 15
Views: 3503

Re: SHARED doesn't work in sub-procedures

@fred, freak: Thank you for your posts. So I know that the topic has reached you.

@Little John: If procedure "One()" calls procedure "Two()", then procedure "Two()" isn't a sub-procedure? How would you describe procedure "Two()" (I'm from germany and I doesn't have the correct english word)?

A ...
by rudd68
Tue Jul 20, 2010 10:25 pm
Forum: Coding Questions
Topic: SHARED doesn't share variables from the non-main-scope
Replies: 15
Views: 3503

Re: SHARED doesn't work in sub-procedures

I think it is a bug or an inaccurate documentation. If it is not a bug then it is my feature wish (and the documentation should be updated.)

Greetings.
by rudd68
Tue Jul 20, 2010 10:02 pm
Forum: Coding Questions
Topic: SHARED doesn't share variables from the non-main-scope
Replies: 15
Views: 3503

Re: SHARED doesn't work in sub-procedures

Thank you netmaestro.

Shared must exist in a minimum of two places in your code to make any sense (and actually do something useful). If it exists in only one place, there is nobody to share with. I doesn't agree with you. Please see the first example in the "Shared" documentation. There is only ...
by rudd68
Tue Jul 20, 2010 8:52 pm
Forum: Coding Questions
Topic: SHARED doesn't share variables from the non-main-scope
Replies: 15
Views: 3503

Re: SHARED doesn't work in sub-procedures

Thank you ts-soft.

But the first definition of the variable "Element" is in the procedure "Random_Element()".

The behavior of "Shared" is differently to written in the documentation.

I have 1100 lines of code, 15 procedures, many variables. Your solution expands the main program code and the ...
by rudd68
Tue Jul 20, 2010 8:14 pm
Forum: Coding Questions
Topic: SHARED doesn't share variables from the non-main-scope
Replies: 15
Views: 3503

SHARED doesn't share variables from the non-main-scope

Hello,

the keyword "Shared" doesn't work, but it isn't forbidden in the documentation:

Procedure.s Create_Display_Text()
Shared Element
Debug Element
Text.s = "Random_Element is: " + Str(Element)
ProcedureReturn Text
EndProcedure

Procedure Random_Element()
Element.l = Random(100) + 1 ...
by rudd68
Mon Jul 05, 2010 1:30 pm
Forum: Coding Questions
Topic: Screenshot of a full-screen game?
Replies: 12
Views: 1729

Re: Screenshot of a full-screen game?

Hello,

this is a code extract from idle's code:

Code: Select all

If gp = 0 
  gp=0
EndIf 
What is the function of this IF: ENDIF block?

Greetings.
by rudd68
Mon Jun 28, 2010 9:48 pm
Forum: Coding Questions
Topic: Should this work?
Replies: 34
Views: 10904

Re: Should this work?

Hello,

Is it necessary to have the Boolean keyword? Wouldn't just surrounding an assignment operation be enough to evaluate it as an expression?
May be, but it will be much clearer like that.
I think no. If you have far indented source code, a Keyword (e.g. Boolean) moves the expression to the ...