0

I wrote a script which will send an OTP (One Time Password) to users Mail ID. So whenever System sends the OTP to the user, I want to start a countdown timer of 1 Minute. But am not sure how to start the Countdown timer using DCL Scripting..Any Idea ?

Below is the script which I am using to generate the OTP..But I need to have a countdown Timer...Is it possible to display the countdown on screen ? Please Help !!

$! RAND - returns a positive random number ("RANDOM") between 0 and 
$!        __CEIL - 1. 
$! sharris-at-sdsdmvax.fb3.noaa.gov 
$ RAND: 
$ 
$ IF F$TYPE(__SEED) .EQS. "" 
$ THEN 
$     ! seed the random number generator, ... 
$     __NOW = F$CVTIME() 
$     __HOUR = 'F$EXTRACT(11,2,__NOW)' 
$     __MINUTE = 'F$EXTRACT(14,2,__NOW)' 
$     __SECOND = 'F$EXTRACT(17,2,__NOW)' 
$     __TICK = 'F$EXTRACT(20,2,__NOW)' 
$ 
$     __SEED == __TICK + (100 * __SECOND) + (6000 * __MINUTE) + - 
         (360000 * __HOUR) 
$     ! the generator tends to do better with a large, odd seed, ... 
$     __SEED == (__SEED .OR. 1) 
$     ! clean up, ... 
$     DELETEX/SYMBOL __NOW 
$     DELETEX/SYMBOL __HOUR 
$     DELETEX/SYMBOL __MINUTE 
$     DELETEX/SYMBOL __SECOND 
$     DELETEX/SYMBOL __TICK 
$ ENDIF 
$ 
$ IF F$TYPE(__CEIL) .EQS. "" THEN __CEIL = %X3FFFFFFF 
$ 
$ __SEED == __SEED * 69069 + 1 
$ RANDOM == (__SEED.AND.%X3FFFFFFF)/(%X40000000/__CEIL) 
$ define sys$output MANAGERS:[EMAL]random.txt
$ sh sym RANDOM
$ deassign sys$output
$ sear MANAGERS:[EMAL]random.txt random /out=MANAGERS:[EMAL]random1.txt
$ open in MANAGERS:[EMAL]random1.txt
$ LOOP4:
$ READ/END_OF_FILE=ENDIT4 IN RANDO
$ GOTO LOOP4
$ ENDIT4:
$ close in
$ RANDOM1 = F$EXTRACT(30,8,RANDO)
$ sh sym RANDOM1
$ mail a.txt smtp%"xx@x.com" /sub="Your Password is ''RANDOM1' "

when I run the above script, my OTP will be as follows:

Your Password is 1218A57A
4

1 に答える 1