Author Topic: Windows Task Sceduler  (Read 4959 times)

0 Members and 1 Guest are viewing this topic.

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Windows Task Sceduler
« on: June 18, 2020, 05:54:20 pm »
I know this is probably a really dumb question; and I'm going way out on a limb here; but is there anything that gets put in a compiler QB64 .exe file that would make it not work with task scheduler? Here is the background... I wrote a program awhile back, did all the testing I needed to do, and then set up task scheduler to have it run each morning at 7:00am. No problems; works fine, lasts a long time.

So, I wrote another program that I also wanted to run at a certain time. No dice; ever. I have tried to kick it off at differing times, nothing. Set up the execution parameters the same as the one that works, nothing. The task scheduler history says that everything went fine; task triggered on scheduler, created task process, task started, action started, action completed, and task completed. All of them within one second of the start time. and the last run result shows up a 0x6F; of which I cannot find any trace of what that means.

Oh, i can run the program just fine; either by the normal double click from file explorer or selecting 'run task' from the task scheduler. Like I said, probably a dumb question, but I figured I try a longshot just in case. Thanks, Mike


Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Re: Windows Task Sceduler
« Reply #1 on: June 20, 2020, 09:33:16 am »
I just got around to putting the program in a batch file and having the task scheduler execute the batch file. Same exact results. I also tried a different approach, with promising results. I use a program called Second Copy to make backup copies of my important data. One of the features of Second Copy is to run a program either before or after the Second Copy profile has run. So I put my program to run after the last profile of the night runs. It worked. Hmmm, this is really weird! Mike

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Windows Task Sceduler
« Reply #2 on: June 20, 2020, 03:23:04 pm »
Did you write the first program, that works fine, with a different version QB64 for the faulty working one now? Then you could rightly suspect a compile difference, given everything else is exactly the same. I think I recall a major update in compiler between v1.3 and v1.4 (or was it v1.2 and v1.3?)

If true, if you have the older version try compiling with it, I think you can still download older versions of QB64.
« Last Edit: June 20, 2020, 03:25:00 pm by bplus »

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Re: Windows Task Sceduler
« Reply #3 on: June 20, 2020, 05:31:39 pm »
Nope, everything I have written has been in 1.3. Something keeps sticking in the back of my head that there is supposed to be something in the very first line of code, or something like that. But for the life of me I can't recall what it is. Thanks, Mike

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Windows Task Sceduler
« Reply #4 on: June 21, 2020, 12:08:00 pm »
It might be worth your time to write your own scheduler, with QB64. Just use TIME$. If you turn your computer on and off a lot, you might be able to add msconfig to your system, if it isn't already installed, and add your QB64 scheduler program to msconfig, so msconfig starts your QB64 scheduler program on start up. Sorry, but I don't work with Windows Task Scheduler, so I don't know what's going on there, other than it sounds like it's snubbing you for not being a Microsoft approved application.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Re: Windows Task Sceduler
« Reply #5 on: June 21, 2020, 09:23:18 pm »
Pete, I have thought about that as well. I have a couple things I want to try first. I'm still working on the 'file open' errors I get randomly. I had them again today. That one is equally weird. Mike

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Re: Windows Task Sceduler
« Reply #6 on: June 24, 2020, 08:53:21 pm »
Pete, I think I will take your advice and write my own. I'm thinking on having a data file with all of the task data, that is read as soon as the task program runs. It would display the scheduled tasks and allow for adding, deleting, or modifying tasks. If any of those three are selected, the data file is updated. I would have a home screen with each of the tasks displayed, and if one of the three modification options are selected, then it would change to a screen to all of that option to be performed. When the modification option is completed, the data file is updated and you are returned to the home screen.

In trying to figure out a format for the data file, I'm thinking of using a value between 0 and 127 to be able to identify which days of the week the task is to be run. A value of 127 means every day, a value of 62 means just on weekdays, a value of 65 means just on weekends, etc.

Thoughts, Mike

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Re: Windows Task Sceduler
« Reply #7 on: June 25, 2020, 06:48:58 pm »
Okay, if I go with a plan to have the days of the week, the task will run, be between 1 and 127, then I obviously need a way to have the number analyzed to see which days the task runs. I know this is not the prettiest code, but it seems to work, and, most importantly, I understand how it works. The variable 'Value' would contain the code for which days the task runs.... I plugged in a few sample numbers for 'Value' and it seemed to work. I did just realize I need to test for a 'Value' that is less than 1 or greater than 127 to be safe.

Code: QB64: [Select]
  1. Value = 64
  2. PRINT Value
  3. Bit7 = Value - 64
  4. IF Bit7 > -1 THEN Sat = 1 ELSE Sat = 0
  5. IF Bit7 < 0 THEN Bit7 = Value
  6. PRINT Bit7
  7. IF Sat = 1 THEN PRINT "Saturday = On " ELSE PRINT "Saturday = Off"
  8. Bit6 = Bit7 - 32
  9. IF Bit6 > -1 THEN Fri = 1 ELSE Fri = 0
  10. IF Bit6 < 0 THEN Bit6 = Bit7
  11. PRINT Bit6
  12. IF Fri = 1 THEN PRINT "Friday = On " ELSE PRINT "Friday = Off"
  13. Bit5 = Bit6 - 16
  14. IF Bit5 > -1 THEN Thu = 1 ELSE Thu = 0
  15. IF Bit5 < 0 THEN Bit5 = Bit6
  16. PRINT Bit5
  17. IF Thu = 1 THEN PRINT "Thursday = On " ELSE PRINT "Thursday = Off"
  18. Bit4 = Bit5 - 8
  19. IF Bit4 > -1 THEN Wed = 1 ELSE Wed = 0
  20. IF Bit4 < 0 THEN Bit4 = Bit5
  21. PRINT Bit4
  22. IF Wed = 1 THEN PRINT "Wednesday = On " ELSE PRINT "Wednesday = Off"
  23. Bit3 = Bit4 - 4
  24. IF Bit3 > -1 THEN Tue = 1 ELSE Tue = 0
  25. IF Bit3 < 0 THEN Bit3 = Bit4
  26. PRINT Bit3
  27. IF Tue = 1 THEN PRINT "Tuesday = On " ELSE PRINT "Tuesday = Off"
  28. Bit2 = Bit3 - 2
  29. IF Bit2 > -1 THEN Mon = 1 ELSE Mon = 0
  30. IF Bit2 < 0 THEN Bit2 = Bit3
  31. PRINT Bit2
  32. IF Mon = 1 THEN PRINT "Monday = On " ELSE PRINT "Monday = Off"
  33. Bit1 = Bit2 - 1
  34. IF Bit1 > -1 THEN Sun = 1 ELSE Sun = 0
  35. IF Bit1 < 0 THEN Bit1 = Bit2
  36. PRINT Bit1
  37. IF Sun = 1 THEN PRINT "Sunday = On " ELSE PRINT "Sunday = Off"

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Windows Task Sceduler
« Reply #8 on: June 25, 2020, 09:08:18 pm »
@lawsonm1 Mike, I have quite a few good functions for date calculation and knowing what day of the week it is. I can give you that code later if you like. It might assist you with task scheduling.
Shuwatch!

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Re: Windows Task Sceduler
« Reply #9 on: June 25, 2020, 10:03:23 pm »
Thanks. I have been using the one that is listed in the DATE$ page on the wiki (http://www.qb64.org/wiki/DATE$), which has worked fine. I'm just playing around right now. My first test is at 4am tomorrow 6/26) morning. I'm just trying to make sure the basic ideas work before I add more bells and whistles. Mike

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Windows Task Sceduler
« Reply #10 on: June 25, 2020, 10:24:47 pm »
@lawsonm1 Here you go. This is used with a PowerShell script for creating a Date Picker and returning back the date as an exit code from PowerShell. I'm sure you can find something in this that is helpful. Enjoy!

QB64 Code:
Code: QB64: [Select]
  1.     DIM date1$
  2.     DIM date2$
  3.  
  4.     date1$ = GetDate
  5.     date2$ = GetDate
  6.     PRINT "The difference between "; date1$; " and "; date2$; " is "; String.Trim(STR$(difference_of_days(date1$, date2$))); " days"
  7.     PRINT WeekDay(date1$)
  8.     PRINT WeekDay(date2$)
  9.     FUNCTION GetDate$
  10.         __GetNewDate
  11.         DIM SHELL$
  12.         DIM a AS LONG
  13.         DIM datepicked AS STRING
  14.         DIM month AS STRING
  15.         DIM day AS STRING
  16.         DIM year AS STRING
  17.         DIM StartDir AS STRING
  18.         StartDir = COMMAND$(0)
  19.         StartDir = LEFT$(StartDir, _INSTRREV(StartDir, "\"))
  20.         SHELL$ = "PowerShell -WindowStyle Hidden -ExecutionPolicy Bypass " + CHR$(34) + "&'" + StartDir + "\GetNewDate.ps1';exit $LASTEXITCODE" + CHR$(34)
  21.         a = _SHELLHIDE(SHELL$)
  22.         SELECT CASE LEN(LTRIM$(STR$(a)))
  23.             CASE 7
  24.                 datepicked = LTRIM$(STR$(a))
  25.                 month = "0" + MID$(datepicked, 1, 1)
  26.                 day = MID$(datepicked, 2, 2)
  27.                 year = MID$(datepicked, 4, 4)
  28.             CASE 8
  29.                 datepicked = LTRIM$(STR$(a))
  30.                 month = MID$(datepicked, 1, 2)
  31.                 day = MID$(datepicked, 3, 2)
  32.                 year = MID$(datepicked, 5, 4)
  33.         END SELECT
  34.         IF datepicked <> "" THEN
  35.             GetDate = month + "-" + day + "-" + year
  36.         ELSE
  37.             GetDate = ""
  38.         END IF
  39.  
  40.     FUNCTION WeekDay$ (formatteddate AS STRING)
  41.         DIM M
  42.         DIM D
  43.         DIM Y
  44.         DIM C
  45.         DIM S1
  46.         DIM S2
  47.         DIM S3
  48.         DIM WkDay
  49.         DIM day AS STRING
  50.         DIM Moon AS STRING
  51.         M = VAL(MID$(formatteddate, 1, 2))
  52.         D = VAL(MID$(formatteddate, 4, 2))
  53.         Y = VAL(MID$(formatteddate, 7, 4))
  54.  
  55.         IF M < 3 THEN M = M + 12: Y = Y - 1 'add 12 to Jan - Feb month, -1 year
  56.         C = Y \ 100: Y = Y MOD 100 'split century and year number
  57.         S1 = (C \ 4) - (2 * C) - 1 'century leap
  58.         S2 = (5 * Y) \ 4 '4 year leap
  59.         S3 = 26 * (M + 1) \ 10 'days in months
  60.         WkDay = (S1 + S2 + S3 + D) MOD 7 'weekday total remainder
  61.         IF WkDay < 0 THEN WkDay = WkDay + 7 'Adjust negative results to 0 to 6
  62.         SELECT CASE WkDay
  63.             CASE 0: day = "Sunday"
  64.             CASE 1: day = "Monday"
  65.             CASE 2: day = "Tuesday"
  66.             CASE 3: day = "Wednesday"
  67.             CASE 4: day = "Thursday"
  68.             CASE 5: day = "Friday"
  69.             CASE 6: day = "Saturday"
  70.         END SELECT
  71.         SELECT CASE M
  72.             CASE 1: Moon = "January"
  73.             CASE 2: Moon = "February"
  74.             CASE 3: Moon = "March"
  75.             CASE 4: Moon = "April"
  76.             CASE 5: Moon = "May"
  77.             CASE 6: Moon = "June"
  78.             CASE 7: Moon = "July"
  79.             CASE 8: Moon = "August"
  80.             CASE 9: Moon = "September"
  81.             CASE 10: Moon = "October"
  82.             CASE 11: Moon = "November"
  83.             CASE 12: Moon = "December"
  84.         END SELECT
  85.         WeekDay = day + ", " + Moon + " " + ordinal_suffix_of(LTRIM$(RTRIM$(STR$(D)))) + ", " + MID$(formatteddate, 7, 4)
  86.  
  87.     FUNCTION check_leap_year (year AS LONG)
  88.         IF year MOD 4 = 0 AND year MOD 100 <> 0 OR year MOD 400 = 0 THEN
  89.             check_leap_year = 1
  90.         ELSE
  91.             check_leap_year = 0
  92.         END IF
  93.  
  94.     FUNCTION no_of_days_in_month (month AS LONG, year AS LONG)
  95.         IF month = 1 OR month = 3 OR month = 5 OR month = 7 OR month = 8 OR month = 10 OR month = 12 THEN
  96.             no_of_days_in_month = 31
  97.         ELSEIF month = 4 OR month = 6 OR month = 9 OR month = 11 THEN
  98.             no_of_days_in_month = 30
  99.         ELSEIF month = 2 THEN
  100.             DIM n AS LONG
  101.             n = check_leap_year(year)
  102.             IF n = 1 THEN
  103.                 no_of_days_in_month = 29
  104.             ELSE
  105.                 no_of_days_in_month = 28
  106.             END IF
  107.         END IF
  108.  
  109.     FUNCTION difference_of_days& (Date1 AS STRING, Date2 AS STRING)
  110.         DIM month1
  111.         DIM day1
  112.         DIM year1
  113.         DIM month2
  114.         DIM day2
  115.         DIM year2
  116.  
  117.         month1 = VAL(MID$(Date1, 1, 2))
  118.         day1 = VAL(MID$(Date1, 4, 2))
  119.         year1 = VAL(MID$(Date1, 7, 4))
  120.  
  121.         month2 = VAL(MID$(Date2, 1, 2))
  122.         day2 = VAL(MID$(Date2, 4, 2))
  123.         year2 = VAL(MID$(Date2, 7, 4))
  124.  
  125.         IF year1 = year2 THEN
  126.             IF month1 = month2 THEN
  127.                 IF day1 = day2 THEN
  128.                     difference_of_days = 0
  129.                     EXIT FUNCTION
  130.                 ELSE
  131.                     difference_of_days = ABS(day1 - day2)
  132.                     EXIT FUNCTION
  133.                 END IF
  134.             ELSEIF month1 < month2 THEN
  135.                 DIM result AS LONG
  136.                 DIM i
  137.                 FOR i = month1 TO month2 - 1
  138.                     result = result + no_of_days_in_month(i, year1)
  139.                 NEXT
  140.                 IF day1 = day2 THEN
  141.                     difference_of_days = result
  142.                     EXIT FUNCTION
  143.                 ELSEIF day1 < day2 THEN
  144.                     result = result + (day2 - day1)
  145.                     difference_of_days = result
  146.                     EXIT FUNCTION
  147.                 ELSE
  148.                     result = result - (day1 - day2)
  149.                     difference_of_days = result
  150.                     EXIT FUNCTION
  151.                 END IF
  152.             ELSE
  153.                 result = 0
  154.                 FOR i = month2 TO month1 - 1
  155.                     result = result + no_of_days_in_month(i, year1)
  156.                 NEXT
  157.                 IF day1 = day2 THEN
  158.                     difference_of_days = result
  159.                     EXIT FUNCTION
  160.                 ELSEIF day2 < day1 THEN
  161.                     result = result + (day1 - day2)
  162.                     difference_of_days = result
  163.                     EXIT FUNCTION
  164.                 ELSE
  165.                     result = result - (day2 = day1)
  166.                     difference_of_days = result
  167.                     EXIT FUNCTION
  168.                 END IF
  169.             END IF
  170.         ELSEIF year1 < year2 THEN
  171.             DIM temp AS LONG
  172.             FOR i = year1 TO year2 - 1
  173.                 IF check_leap_year(i) = 1 THEN
  174.                     temp = temp + 366
  175.                 ELSE
  176.                     temp = temp + 365
  177.                 END IF
  178.             NEXT
  179.             IF month1 = month2 THEN
  180.                 IF day1 = day2 THEN
  181.                     difference_of_days = temp
  182.                     EXIT FUNCTION
  183.                 ELSEIF day1 < day2 THEN
  184.                     difference_of_days = temp + (day2 - day1)
  185.                     EXIT FUNCTION
  186.                 ELSE
  187.                     difference_of_days = temp - (day1 - day2)
  188.                     EXIT FUNCTION
  189.                 END IF
  190.             ELSEIF month1 < month2 THEN
  191.                 result = 0
  192.                 FOR i = month1 TO month2 - 1
  193.                     result = result + no_of_days_in_month(i, year2)
  194.                 NEXT
  195.                 IF day1 = day2 THEN
  196.                     difference_of_days = temp + result
  197.                     EXIT FUNCTION
  198.                 ELSEIF day1 < day2 THEN
  199.                     result = result + (day2 - day1)
  200.                     difference_of_days = temp + result
  201.                     EXIT FUNCTION
  202.                 ELSE
  203.                     result = result - (day1 - day2)
  204.                     difference_of_days = temp + result
  205.                     EXIT FUNCTION
  206.                 END IF
  207.             ELSE
  208.                 result = 0
  209.                 FOR i = month2 TO month1 - 1
  210.                     result = result + no_of_days_in_month(i, year2)
  211.                 NEXT
  212.                 IF day1 = day2 THEN
  213.                     difference_of_days = temp - result
  214.                     EXIT FUNCTION
  215.                 ELSEIF day2 < day2 THEN
  216.                     result = result + (day1 - day2)
  217.                     difference_of_days = temp - result
  218.                     EXIT FUNCTION
  219.                 ELSE
  220.                     result = result - (day2 - day1)
  221.                     difference_of_days = temp - result
  222.                     EXIT FUNCTION
  223.                 END IF
  224.             END IF
  225.         ELSE
  226.             temp = 0
  227.             FOR i = year2 TO year1 - 1
  228.                 IF check_leap_year(i) = 1 THEN
  229.                     temp = temp + 366
  230.                 ELSE
  231.                     temp = temp + 365
  232.                 END IF
  233.             NEXT
  234.             IF month1 = month2 THEN
  235.                 IF day1 = day2 THEN
  236.                     difference_of_days = temp
  237.                     EXIT FUNCTION
  238.                 ELSEIF day2 < day1 THEN
  239.                     difference_of_days = temp + (day1 - day2)
  240.                     EXIT FUNCTION
  241.                 ELSE
  242.                     difference_of_days = temp - (day2 - day1)
  243.                     EXIT FUNCTION
  244.                 END IF
  245.             ELSEIF month2 < month1 THEN
  246.                 result = 0
  247.                 FOR i = month2 TO month1 - 1
  248.                     result = result + no_of_days_in_month(i, year1)
  249.                 NEXT
  250.                 IF day1 = day2 THEN
  251.                     difference_of_days = temp + result
  252.                     EXIT FUNCTION
  253.                 ELSEIF day2 < day1 THEN
  254.                     result = result + (day1 - day2)
  255.                     difference_of_days = temp + result
  256.                     EXIT FUNCTION
  257.                 ELSE
  258.                     result = result - (day2 - day1)
  259.                     difference_of_days = temp + result
  260.                     EXIT FUNCTION
  261.                 END IF
  262.             ELSE
  263.                 result = 0
  264.                 FOR i = month1 TO month2 - 1
  265.                     result = result + no_of_days_in_month(i, year1)
  266.                 NEXT
  267.                 IF day1 = day2 THEN
  268.                     difference_of_days = temp - result
  269.                     EXIT FUNCTION
  270.                 ELSEIF day1 < day2 THEN
  271.                     result = result + (day2 - day1)
  272.                     difference_of_days = temp - result
  273.                     EXIT FUNCTION
  274.                 ELSE
  275.                     result = result - (day1 - day2)
  276.                     difference_of_days = temp - result
  277.                     EXIT FUNCTION
  278.                 END IF
  279.             END IF
  280.         END IF
  281.     FUNCTION ordinal_suffix_of$ (i AS STRING)
  282.         DIM j
  283.         DIM k
  284.         j = VAL(i) MOD 10
  285.         k = VAL(i) MOD 100
  286.         IF j = 1 AND k <> 11 THEN
  287.             ordinal_suffix_of = i + "st"
  288.         ELSEIF j = 2 AND k <> 12 THEN
  289.             ordinal_suffix_of = i + "nd"
  290.         ELSEIF j = 3 AND k <> 13 THEN
  291.             ordinal_suffix_of = i + "rd"
  292.         ELSE
  293.             ordinal_suffix_of = i + "th"
  294.         END IF
  295. FUNCTION Clock$
  296.     hour$ = LEFT$(TIME$, 2): H% = VAL(hour$)
  297.     min$ = MID$(TIME$, 3, 3)
  298.     IF H% >= 12 THEN ampm$ = " PM" ELSE ampm$ = " AM"
  299.     IF H% > 12 THEN
  300.         IF H% - 12 < 10 THEN hour$ = STR$(H% - 12) ELSE hour$ = LTRIM$(STR$(H% - 12))
  301.     ELSEIF H% = 0 THEN hour$ = "12" ' midnight hour
  302.     ELSE: IF H% < 10 THEN hour$ = STR$(H%) ' eliminate leading zeros
  303.     END IF
  304.     Clock$ = hour$ + min$ + ampm$
  305.     FUNCTION String.Trim$ (trimString AS STRING)
  306.         trimString = LTRIM$(RTRIM$(trimString))
  307.         String.Trim = trimString
  308. SUB __GetNewDate
  309.     IF _FILEEXISTS("GetNewDate.ps1") = 0 THEN 'remove this line if you are compiling in FreeBasic
  310.         '#lang "qb" 'uncomment this line if compiling in FreeBasic
  311.         DIM A$
  312.         A$ = ""
  313.         A$ = A$ + "haI_D5\SC334mNUjoPEYB=A\9JkFF0]8TXT54XBgFAZH?\R3^>CgJ`=>[mDe"
  314.         A$ = A$ + "6#lUa1nThG0WhTX4JjR42Q?Td>n=SOck=aolkoHLDTgRd4Ph=F[Q=;5YGAg0"
  315.         A$ = A$ + "T`D=2Kl_V779gYmO]D]Ag]cm3nB5M7?nf^M^Y]\m7WT8h<:bUaOlR;NE<MY0"
  316.         A$ = A$ + "n0G_U:2aD1XMLOFg>mGI`BN>i:HWg\UO2H8YIEbNBlV[T9P2C9_h[Mk#<[#T"
  317.         A$ = A$ + "Z`iB=?[lVl_i`\J0a`P0861E8C1#LAAhO18E[6TXXglcQLfS6M2i\AWJcJ1\"
  318.         A$ = A$ + "7[WeP##TW25Q15#T9KTJ\2BOD]5jfiK5m[oKIFBgD8c3W9EkA5UQ69GbhVR6"
  319.         A$ = A$ + "U5gI0S:Ph8Z:Qcn\?W97hJ:GI`kC2W:Sae1U0KA;G;g]#6AC3h:V0\<N5EX1"
  320.         A$ = A$ + "knCYk]]XA73TKSAcn3[e=1Vj[T2SS75iDa83k<0V=iUKA<_K?:o:#L8aNWd>"
  321.         A$ = A$ + "nLLkI^TKXcXWN2IhS?_5CmhNjC>?cBKaA=6j\95nhULZ#Nkk1mF1Nh#FmM=f"
  322.         A$ = A$ + "f\9edTa<6TPEmNU>d^VE^[Ec2Xa<#lO#g6>LdoFQcblo6acVImQZVR#3AYMA"
  323.         A$ = A$ + "\>2[#Z:?K;l\iLkajT_?O5aY4S7LgOdNM95jKo8cGUIU]LFg_jkSl;Mn=DI_"
  324.         A$ = A$ + "mG83AUA4Mj=MJDDZIec]9^C9?dnKKh[EL4lNCfe8eR2ki=no3Z1[7Y_CeQ]F"
  325.         A$ = A$ + "Z`\KT:>EGgN6amG0CUkg%%%0"
  326.         DIM btemp$
  327.         DIM i&
  328.         DIM B$
  329.         DIM C%
  330.         DIM F$
  331.         DIM C$
  332.         DIM j
  333.         DIM t%
  334.         DIM B&
  335.         DIM X$
  336.         DIM BASFILE$
  337.         btemp$ = ""
  338.         FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4)
  339.             IF INSTR(1, B$, "%") THEN
  340.                 FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1)
  341.                     IF F$ <> "%" THEN C$ = C$ + F$
  342.                 NEXT: B$ = C$: END IF: FOR j = 1 TO LEN(B$)
  343.                 IF MID$(B$, j, 1) = "#" THEN
  344.             MID$(B$, j) = "@": END IF: NEXT
  345.             FOR t% = LEN(B$) TO 1 STEP -1
  346.                 B& = B& * 64 + ASC(MID$(B$, t%)) - 48
  347.                 NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1
  348.                 X$ = X$ + CHR$(B& AND 255): B& = B& \ 256
  349.         NEXT: btemp$ = btemp$ + X$: NEXT
  350.         BASFILE$ = _INFLATE$(btemp$): btemp$ = ""
  351.         OPEN "GetNewDate.ps1" FOR OUTPUT AS #1
  352.         PRINT #1, BASFILE$;
  353.         CLOSE #1
  354.     END IF 'remove this line if you are compiling in FreeBasic
 [ You are not allowed to view this attachment ]  
« Last Edit: June 26, 2020, 09:22:32 am by SpriggsySpriggs »
Shuwatch!