Search found 176 matches

by Robert
Fri Jan 22, 2021 5:04 pm
Forum: Component Pascal
Topic: Assigning values to pointers or passing pointers to VAR args
Replies: 12
Views: 21035

Re: Assigning values to pointers or passing pointers to VAR

I now also understand examples 3 to 5. I was confused by $ because I misinterpreted it as a kind of pointer dereferencing specialized for strings (so p^$ would be a double dereferencing); but apparently it can be just ignored. Careful! The example below shows some differences; open up the strings i...
by Robert
Fri Jan 22, 2021 2:33 pm
Forum: Component Pascal
Topic: Assigning values to pointers or passing pointers to VAR args
Replies: 12
Views: 21035

Re: Assigning values to pointers or passing pointers to VAR

Thanks for your reply. Here are some examples I found in the 1.7.2 Windows Blackbox framework: (module, procedure, statement) HostCFrames, WinInsertItem, tvi.pszText := s HostCFrames, InitClass, class.lpszClassName := "Oberon Ctrl" StdDialog, CheckFilter, par.label := i.item$ ... I have l...
by Robert
Fri Jan 22, 2021 11:52 am
Forum: Component Pascal
Topic: Assigning values to pointers or passing pointers to VAR args
Replies: 12
Views: 21035

Re: Assigning values to pointers or passing pointers to VAR

After studying several versions of the Component Pascal language report ... why is it possible to ... Same question for assigning a string literal to a POINTER TO ARRAY OF CHAR. I don't think it is. I get the compile error "incompatible assignment". PROCEDURE Do*; VAR dart : POINTER TO AR...
by Robert
Thu Jan 07, 2021 11:12 pm
Forum: Component Pascal
Topic: A REAL bad program compiles well
Replies: 11
Views: 15220

Re: A REAL bad program compiles well

What does 'contained' mean? Is it ∈? I probably agree with you! If by "e" you mean set membership I might, rather pedantically, word it differently by saying the value (say x) must lie in the interval or range MIN(SHORTREAL) ≤ x ≤ MAX(SHORTREAL) rather than saying x is contained in some s...
by Robert
Wed Jan 06, 2021 8:32 pm
Forum: Component Pascal
Topic: A REAL bad program compiles well
Replies: 11
Views: 15220

Re: A REAL bad program compiles well

... (The Language Reoprt says) "A real number is always of type REAL." Maybe it would be better to simply delete this sentance, but I don't have strong views on the subject. I have changed my mind! CONST a = 100000. / 3. - 33333.; PROCEDURE Rnd (x : REAL) : SHORTREAL; VAR s : SHORTREAL; B...
by Robert
Wed Jan 06, 2021 5:13 pm
Forum: Component Pascal
Topic: A REAL bad program compiles well
Replies: 11
Views: 15220

Re: A REAL bad program compiles well

Assignment compatible An expression e of type Te is assignment compatible with a variable v of type Tv if one of the following conditions hold: ... 5. Tv is a numeric type and e is a constant expression whose value is contained in Tv; I think the quote above (from the Language Report) allows CONST ...
by Robert
Wed Jan 06, 2021 2:14 pm
Forum: Component Pascal
Topic: A REAL bad program compiles well
Replies: 11
Views: 15220

Re: A REAL bad program compiles well

The type of a real constant is SHORTREAL if the constant value belongs to SHORTREAL, or REAL otherwise (see 6.1). . While I agree that the Language Report does not seem to clearly describe the BBox compiler behaviour (and I don't want the behaviour changed) the above suggestion does not capture the...
by Robert
Wed Jan 06, 2021 11:07 am
Forum: Component Pascal
Topic: A REAL bad program compiles well
Replies: 11
Views: 15220

Re: A REAL bad program compiles well

VAR x : SHORTREAL; BEGIN x := 0.3 It looks like this code compiles ok in BlackBox, but not in Gardens Point. As I read the language report "0.3" is a real (see section 3.2). This section also says A real number is always of type REAL. so it looks like a BlackBox compiler error? BUT I much...
by Robert
Tue Jan 05, 2021 7:59 pm
Forum: Component Pascal
Topic: A REAL bad program compiles well
Replies: 11
Views: 15220

Re: A REAL bad program compiles well

Colleagues, As far as I understand, -0.4523987 cannot be represented in the 4-byte format. Correct; the closest REAL number is 0.452398699999999986953724828708800487220287322998046875 (exactly). The closest SHORTREAL number is 0.4523986876010894775390625 (exactly). A simpler example is 0.3 which, a...
by Robert
Tue Aug 25, 2020 9:36 am
Forum: Bug
Topic: MAX with two arguments
Replies: 10
Views: 15850

Re: MAX with two arguments

Permitting the expression MAX(INTEGER, 0) looks like an error to me, and should be treated as a compiler bug. I have not followed this discussion very closely, so have two questions: 1 - Do the proposed changes to DevCPB fully resolve this issue? 2 - Is the problem with characters the same issue, or...