![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I sure hope this is a good place to post this? Anyways, I have recently started at a new company which uses A Unidata/PICK/BASIC system. I have absolutely 0 programming experience and my fiirst class (in Denver, CO. at RocketSoftware) for the intro to Unidata Pick/BASIC programminng isn't scheduled until january Soooo... I am hopingthat I can find help here during my first few months and try to mange to do as much reading as possible in order to stay afloat. I have found a few online publications (including Sisk's book on the subject) that I think should help. If anyone here can help me with the following "project" that I am using as practice I would be forever grateful! here is what I am trying to do; I need to create a routine (program) in our PICK/BASIC system that does the following; allows a user to input two dates. • Dates have to be valid • Both dates have to be greater than the current date (today) and less than a year from the current date • The second date has to be greater than the first date I have done a few smaller practice projects, but I guess I have not gotten to the chapter that covers what I would GUESS is using the OCONV tool to convert the dates and then somehow check to make sure the rules above are enforced. I am hoping that by seeing this code written out I can use it as a way to learn some of the syntax, and get a better understanding of how to do something simple like this Like I said, ANY help would be greatly appreciated! |
#3
| |||
| |||
|
|
I sure hope this is a good place to post this? Anyways, I have recently started at a new company which uses A Unidata/PICK/BASIC system. I have absolutely 0 programming experience and my fiirst class (in Denver, CO. at RocketSoftware) for the intro to Unidata Pick/BASIC programminng isn't scheduled until january Soooo... I am hopingthat I can find help here during my first few months and try to mange to do as much reading as possible in order to stay afloat. I have found a few online publications (including Sisk's book on the subject) that I think should help. If anyone here can help me with the following "project" that I am using as practice I would be forever grateful! here is what I am trying to do; I need to create a routine (program) in our PICK/BASIC system that does the following; allows a user to input two dates. • Dates have to be valid • Both dates have to be greater than the current date (today) and less than a year from the current date • The second date has to be greater than the first date I have done a few smaller practice projects, but I guess I have not gotten to the chapter that covers what I would GUESS is using the OCONV tool to convert the dates and then somehow check to make sure the rules above are enforced. I am hoping that by seeing this code written out I can use it as a way to learn some of the syntax, and get a better understanding of how to do something simple like this Like I said, ANY help would be greatly appreciated! |
#4
| |||
| |||
|
|
• Dates have to be valid • Both dates have to be greater than the current date (today) and less than a year from the current date |
#5
| |||
| |||
|
|
Welcome Edukes I would do this internal.date = ICONV(value,"D") instead of this 038 internal.date = OCONV(value,"DI") |
#6
| |||
| |||
|
|
Douglas Tatelman wrote: Welcome Edukes I would do this internal.date = ICONV(value,"D") instead of this 038 internal.date = OCONV(value,"DI") Genuine question, (bearing all the caveats from my original post in mind), Why? Thanks Regards Mike |
#7
| |||
| |||
|
|
Because you'll get in internal date if it is valid in any format, empty string if not valid. I've only seen the DI used in dict items on certain releases, but that's just me. On Sep 24, 3:14*pm, "Mike Wooding" <mikewood... (AT) email (DOT) com> wrote: Douglas Tatelman wrote: Welcome Edukes I would do this internal.date = ICONV(value,"D") instead of this 038 internal.date = OCONV(value,"DI") Genuine question, (bearing all the caveats from my original post in mind), Why? Thanks Regards Mike- Hide quoted text - - Show quoted text - |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Also, for anyone interested; here is what I ended up with (again thanks to several peoples input and a LOT of reading) This works exactly as I wanted it to, and as you can see I added a few extras for "neatness" ![]() * * Dates have to be valid * * Both dates have to be greater than the current date and less than a year from the current date * * The second date has to be greater than the first date * * * CS=@(-1) ; * CLEAR SCREEN * * * CLLN=@(-4); * CLEAR LINE * * * CRT CS * * * PROMPT ':' * * * DATE.OK=1 * * * LOOP * * * * *CRT @(5,5):CLLN:'ENTER DATE 1 ': * * * * *INPUT DATE1 * * * * *DATE1=UPCASE(DATE1) * * * * *IF DATE1='X' OR DATE1='' THEN GO 999 * * * * *DATE1 = ICONV(DATE1,'D') * IF DATE1 > DATE() THEN * * *IF DATE1 < (DATE() + 365) THEN DATE.OK=0 * END * * * UNTIL (DATE1 > DATE()) AND (DATE1 < (DATE() + 365)) DO * * * * *CALL NT.ERRORS('INVALID! MUST BE GREATER THAN THE CURRENT') * * * REPEAT * * * CRT 'DATE OK' * * * LOOP * * * * *CRT 'ENTER DATE 2 ': * * * * *INPUT DATE2 * * * * *IF DATE2='X' OR DATE2='' THEN GO 999 * * * * *DATE2 = ICONV(DATE2,'D') * * * * *IF DATE2 > DATE() THEN * * * * * * IF DATE2 < (DATE() + 365) THEN * * * * * * * *IF DATE2 > DATE1 THEN EXIT * * * * * * END * * * * *END * * * * *CRT 'INVALID! THIS DATE MUST BE GREATER THAN THE FIRSTDATE ENTERED' * * * REPEAT 999 END |
![]() |
| Thread Tools | |
| Display Modes | |
| |