Issue with 4NT

Feb 4, 2010
4
0
Hello Forum,
I am having an issue with 4NT (version 6.01.245U) running on WIN XP SP3. Great product, love it, but the following small batch file (simplied for posting reasons) drives me mad, can't get it to work as expected. The idea is to have a timeout for the loop.

Code:
set datetime=%@agedate[%@eval[%@makeage[%_date,%_time] + 600000000]]
set my_date=%@instr[0,10,%datetime%]
set my_time=%@instr[11,8,%datetime%]
do until datetime %my_date% %my_time%
  echos .
  delay 1
enddo

4NT always issues a warning that the syntax of the line preceding the enddo (e.g. "delay 1") is incorrect. If I delete that line, it complains about the syntax of "echos ." Error message currently reads as follows:

.path+name_of_file [8] Syntax: DELAY [/B /M] [seconds]

It appears to me that the loop is being started (noticeable by the "." being printed on screen and the delay of 1 second), but then, for some obscure reason, it is not able to continue and attributes that to the last statement within the body of the loop.

I am either blind or it is a bug ...

Any input greatly appreciated.

Best regards,

Klaus
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,425
85
Albuquerque, NM
prospero.unm.edu
Hello Forum,
I am having an issue with 4NT (version 6.01.245U) running on WIN XP SP3. Great product, love it, but the following small batch file (simplied for posting reasons) drives me mad, can't get it to work as expected. The idea is to have a timeout for the loop.

do until datetime %my_date% %my_time%

In 4NT v6, DO UNTIL DATETIME didn't support variables, only a literal (verbatim) date and time. Support for variables in this syntax was added in version 7....
 
Feb 4, 2010
4
0
Charles,
many thanks for your answer - that explains the issue I was having (and I can also confirm that DO UNTIL DATETIME works with verbatim date and time).

The error message was very misleading and the help file didn't provide a great deal of help for the DO UNTIL DATETIME command either.

After a quick thought I have come up with a workaround that should do for the moment as follows - albeit it is not as clear as the original idea:

Code:
set endtime=%@eval[%@makeage[%_date,%_time] + 600000000]
do until %@makeage[%_date,%_time] gt %endtime
    echos .
    delay 2
enddo
NOTE: The +600000000 actually represents starttime plus 60 seconds (i.e. 1 minute) as makeage works with "age" which is "is the time elapsed since 1601-01-01 00:00:00 (local time) as a multiple of 100 ns" as per the help file.

Regards,

Klaus
 
May 20, 2008
3,515
4
Elkridge, MD, USA
Charles Dye wrote:
| ---Quote (Originally by Atom 2)---
| Hello Forum,
| I am having an issue with 4NT (version 6.01.245U) running on WIN XP
| SP3. Great product, love it, but the following small batch file
| (simplied for posting reasons) drives me mad, can't get it to work
| as expected. The idea is to have a timeout for the loop.
|
| do until datetime %my_date% %my_time%
| ---End Quote---
| In 4NT v6, DO UNTIL DATETIME didn't support variables, only a
| literal (verbatim) date and time. Support for variables in this
| syntax was added in version 7....

Regardless, the other potential issue is the DO requires ISO date and
24-hour time, while you used default (system) format. On my system they are
the same, but is it on yours?
--
Steve
 
Feb 4, 2010
4
0
Charles Dye wrote:
Regardless, the other potential issue is the DO requires ISO date and
24-hour time, while you used default (system) format. On my system they are
the same, but is it on yours?
I was abel to read those requirements from the help file and checked them prior to my initial post. And yes, my default system format is 24-hour time. A 12-hour time format (with am/pm suffix) is only common in English speaking countries like the UK or the US but is only rarely used in German speaking countries like Austria.

Nevertheless thanks for your thoughts,

Klaus
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,425
85
Albuquerque, NM
prospero.unm.edu
many thanks for your answer - that explains the issue I was having (and I can also confirm that DO UNTIL DATETIME works with verbatim date and time).

The error message was very misleading and the help file didn't provide a great deal of help for the DO UNTIL DATETIME command either.

It is an odd limitation and very peculiar behavior, I must agree.

But it's very very unlikely that Rex will have any interest in revisiting version 6. I'd strongly recommend investigating an update to the current release version 11.
 

samintz

Scott Mintz
May 20, 2008
1,488
15
Solon, OH, USA
Although I haven't tried it, a form of dynamic programming might be
possible. As I said, I have no idea if this works or not...

set datetime=%@agedate[%@eval[%@makeage[%_date,%_time] + 100000000]]
set my_date=%@instr[0,10,%datetime]
set my_time=%@instr[11,8,%datetime]
set do_line=do until datetime %my_date %my_time
%do_line
echos .
delay 1
enddo

-Scott

Atom 2 <> wrote on 02/04/2010 11:24:52 AM:


> Charles,
> many thanks for your answer - that explains the issue I was having
> (and I can also confirm that DO UNTIL DATETIME works with verbatim
> date and time).
>
> The error message was very misleading and the help file didn't
> provide a great deal of help for the DO UNTIL DATETIME command either.
>
> After a quick thought I have come up with a workaround that should
> do for the moment as follows - albeit it is not as clear as the original
idea:

>
>
> Code:
> ---------
> set endtime=%@eval[%@makeage[%_date,%_time] + 600000000]
> do until %@makeage[%_date,%_time] gt %endtime
> echos .
> delay 2
> enddo
> ---------
> NOTE: The +600000000 actually represents starttime plus 60 seconds
> (i.e. 1 minute) as makeage works with "age" which is "is the time
> elapsed since 1601-01-01 00:00:00 (local time) as a multiple of 100
> ns" as per the help file.
>
> Regards,
>
> Klaus
>
>
>
>
 
Feb 4, 2010
4
0
Although I haven't tried it, a form of dynamic programming might be
possible. As I said, I have no idea if this works or not...

set datetime=%@agedate[%@eval[%@makeage[%_date,%_time] + 100000000]]
set my_date=%@instr[0,10,%datetime]
set my_time=%@instr[11,8,%datetime]
set do_line=do until datetime %my_date %my_time
%do_line
echos .
delay 1
enddo

-Scott
Hi Scott,
your suggestion works as well - so there are now a few options to deal with the issue.

Regards,

Klaus
 
Similar threads
Thread starter Title Forum Replies Date
G v28 Display Issue Support 7
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
fpefpe How to? issue with % and evaluation Support 5
cgunhouse Standard User Account Issue Support 2
samintz WAD Display wrapping issue Support 5
M TCC color issue in ConEmu Support 4
samintz Timer issue Support 4
Alpengreis Documentation Minor issue in help file for view /E Support 1
samintz WAD ANSI issue Support 3
D TCSTART issue after reinstallation Support 14
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
Chen Touboul Overtyping issue - i press the Insert key, help till press enter for new line in TCC Support 2
Y TCC and Cmder imcompatibility issue Support 7
M Another possibly strange remote registry issue Support 5
T WAD bpokestr issue Support 5
D High-DPI Scaling issue Support 1
S CMDebug 22 issue with del command Support 1
cgunhouse Foldermonitor Issue Support 7
samintz Build 38 Install issue Support 5
rps WAD Setlocal issue Support 4
Luiz Rodrigues Issue with Maven Support 1
Seven Update / install issue with 20.0.20.10.32 take command Support 7
Fross WebDav Drive Mapping Issue Support 19
D Upgrade issue Support 3
Fross V20b8 Everything Issue Support 5
T TCC display issue Support 1
cgunhouse _logfile Issue Support 5
T Fixed Querybox issue Support 1
cgunhouse Fixed Share Memory Issue Support 5
cgunhouse Foldermonitor with "/E" Option Issue Support 6
Fross TabComplete Argument Issue Support 1
fpefpe How to? Stange start up issue Support 1
C cosmetic issue with LIST's (I) Support 9
jbarnes1967 TC 18.00 x64 issue with lua io.popen() Support 2
D How to? Wildcards as sets - looping issue with FOR and REN Support 7
T WAD Free issue Support 6
R Fixed v17.0.54 Tab->COMSPEC Dialog Box Issue Support 2
R Minor Cosmetic Issue in Take Command Window Support 2
cgunhouse One line IFF ... Then ... Else ... EndIFF Statement issue in V17 Support 13
cgunhouse IFTP Path Issue in V17 - Fixed Support 7
S BDEBUGGER issue Support 9
cgunhouse @ISPROC Issue Support 15
cgunhouse TCMD.INI Issue Support 7
T Fixed multi-line alias issue Support 13
R WAD issue with filename completion with system and hidden files Support 8
D Strange issue with FOR loop Support 15
C Install Issue with 3rd Party Privelege Escalation Support 2
W Button command issue Support 5
S XenForo issue Support 8

Similar threads