Post Reply 
HMS commands
12-12-2015, 10:54 PM (This post was last modified: 12-12-2015 11:00 PM by Tyann.)
Post: #3
RE: HMS commands
Bonjour
J'ai écrit ces fonctions pour mon usage, si cela peut vous être utile.

Hello
I wrote for my use these functions if it can be useful .

Code:
#pragma mode( separator(.,;) integer(d32) )
EXPORT ➞HMS(s)
BEGIN
 //hh.dddddddd...
 LOCAL a:=IFTE(3<HSeparator<9,",",".");
 s:=REPLACE(STRING(→HMS(s)),a,"");
 s:=REPLACE(s,"°",a);
 s:=REPLACE(s,"′","");
 s:=REPLACE(s,"″","");
 EXPR(s);
END;
EXPORT HMS➞(t)
BEGIN
 // t=hh.mmss
 LOCAL a,l,p,s:=STRING(t);
 a:=IFTE(3<HSeparator<9,",",".");
 s:=REPLACE(s,a,"°");
 p:=INSTRING(s,"°");
 l:=DIM(s)-p;
 IF l==1  OR l==3 THEN
   s:=s+"0";
 END;
 IF l>2 THEN
   s:=LEFT(s,p+2)+"′"+MID(s,p+3);
 END;
 HMS→(EXPR(s));
END;
EXPORT HMS┼(t1,t2)
BEGIN
 //t1,t2=hh.mmss 
 ➞HMS(HMS➞(t1)+HMS➞(t2));
END;
EXPORT HMS―(t1,t2)
BEGIN
 //t1,t2=hh.mmss
 ➞HMS(HMS➞(t1)-HMS➞(t2));
END;
Cela n'est pas évident à voir mais la flèche utilisée dans la définition des fonctions
est différente de la flèche utilisée dans les fonctions intégrées.

This is not easy to see but the arrow used in the definition of functions
is different from the boom used in built-in functions .

Faites un copier-coller du code, plutot que de le taper à la main.
Make a copy and paste of the code, rather than typing it in by hand .

Sorry for my english
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HMS commands - mcdouga99 - 12-12-2015, 09:32 PM
RE: HMS commands - DrD - 12-12-2015, 10:11 PM
RE: HMS commands - Tyann - 12-12-2015 10:54 PM
RE: HMS commands - mcdouga99 - 12-15-2015, 02:25 AM
RE: HMS commands - Daniel - 12-16-2015, 01:59 PM



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