Post Reply 
13012 vs 12066
01-22-2018, 10:17 AM
Post: #1
13012 vs 12066
Hello,

In version 12066 this line of code run without issue, but in the BETA 13012
I get a syntax error, I have tried many things but no solution.



JDn:=DateG2JJ(date); OK in 12066

In the BETA the cursor is positionned here : (see the sign !)

JDn:=DateG2JJ!(date); syntax error.

(If I destroy *JDn:=* no syntax error but I need the entire line.)

One may help ?

Gérard.
Find all posts by this user
Quote this message in a reply
01-22-2018, 10:53 AM
Post: #2
RE: 13012 vs 12066
(01-22-2018 10:17 AM)ggauny@live.fr Wrote:  Hello,

In version 12066 this line of code run without issue, but in the BETA 13012
I get a syntax error, I have tried many things but no solution.



JDn:=DateG2JJ(date); OK in 12066

In the BETA the cursor is positionned here : (see the sign !)

JDn:=DateG2JJ!(date); syntax error.

(If I destroy *JDn:=* no syntax error but I need the entire line.)

One may help ?

Could you list routine DateG2JJ for us? There must be some variable in there that is now a keyword but wasn't used back in 12066.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
01-22-2018, 11:17 AM
Post: #3
RE: 13012 vs 12066
Hello,

Here is the routine :

DateG2JJ(date) // for date ≥ oct 15 1582 (2299161)
BEGIN

LOCAL year,month,day;
LOCAL cnt,diz;

// Cut the date YYYY.MMDD into sub parts
year:=IP(date); // YYYY
month:=IP(100*FP(date)); // MM
day:=IP(FP(FP(date)*100)*100); // DD

// Move the beginning of the year to
// March 1st (adding 1 day, e.g. feb 29th
// becomes easier if at the end)
IF month<3 THEN
year:=year-1;
month:=month+12;
END;

// Cut the year into parts
// (Needed for converting Gregorian
// calendar dates to JDN)
cnt:=IP(year/100); // [YY]YY
diz:=IP(year-100*IP(year/100)); //YY[YY]

// julian day number at noon
// from gregorian date YYYY.MMDD
RETURN IP((146097*cnt+6884480)/4)
+IP(1461*diz/4)
+IP((153*month-457)/5)
+day-1;
END;


Hope you can me help.

Gérard.
Find all posts by this user
Quote this message in a reply
01-22-2018, 01:07 PM (This post was last modified: 01-22-2018 01:09 PM by DrD.)
Post: #4
RE: 13012 vs 12066
The EXPORT command:

Code:

 // for date ≥ oct 15 1582 (2299161)
EXPORT DateG2JJ(date)
BEGIN

  LOCAL year,month,day;
  LOCAL cnt,diz;

// Cut the date YYYY.MMDD into sub parts
  year:=IP(date); // YYYY
  month:=IP(100*FP(date)); // MM
  day:=IP(FP(FP(date)*100)*100); // DD

// Move the beginning of the year to
// March 1st (adding 1 day, e.g. feb 29th
// becomes easier if at the end)
  IF month<3 THEN
    year:=year-1;
    month:=month+12;
  END;

// Cut the year into parts
// (Needed for converting Gregorian
// calendar dates to JDN)
  cnt:=IP(year/100); // [YY]YY
  diz:=IP(year-100*IP(year/100)); //YY[YY]

// julian day number at noon
// from gregorian date YYYY.MMDD
  RETURN (
          IP((146097*cnt+6884480)/4) + 
          IP(1461*diz/4) + 
          IP((153*month-457)/5) +day-1
         );
END;

-Dale-
Find all posts by this user
Quote this message in a reply
01-22-2018, 02:40 PM
Post: #5
RE: 13012 vs 12066
(01-22-2018 10:17 AM)ggauny@live.fr Wrote:  In the BETA the cursor is positionned here : (see the sign !)

JDn:=DateG2JJ!(date); syntax error.

A syntax error is commonly a compilation error, meaning that DateG2JJ has not been compiled correctly or does not yet exist.


If you are using DateG2JJ in previous lines with respect to where you have defined it, you can move it before the function that uses it
Code:
DateG2JJ(date) //Defined before being used in another function
BEGIN
  ....
END;

Other
BEGIN
  LOCAL JDn:=DateG2JJ(date);
END;

Or put lines before "DateG2JJ();"
Code:
DateG2JJ(); //Declared/reserved as a function, for its anticipated use

Other
BEGIN
  LOCAL JDn:=DateG2JJ(date);
END;

DateG2JJ(date)
BEGIN
  ....
END;

I do not think the error is due to the firmware, you can try 13217 instead of 13012

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
01-22-2018, 03:33 PM
Post: #6
RE: 13012 vs 12066
Thanks, it run !

Gérard.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)