Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lawsonm1

Pages: [1] 2 3 ... 5
1
QB64 Discussion / Re: Windows Task Sceduler
« 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

2
QB64 Discussion / Re: Windows Task Sceduler
« 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"

3
QB64 Discussion / Re: Windows Task Sceduler
« 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

4
Programs / Re: Television by Sierraken and B+
« on: June 24, 2020, 08:41:44 pm »
Well, I'm am nowhere close to being even a 'database novice". The last database program I ever did anything with was PC-File running on DOS. Right now I'm trying to figure out the best way to dig through my computer and get a listing of all of the video files I have. Just having a listing, whether or not they are color or B/W, and a category, is a good enough start. Maybe add the year made, and a few actors names? I'm still thinking about the how and what to do so I will be able to understand how to start fleshing out some code. If you all are thinking of a real database, that would be out of my league. Mike

5
Programs / Re: Television by Sierraken and B+
« on: June 22, 2020, 10:26:35 am »
My apologies to SierraKen and Bplus if this is hijacking your original post. If a new thread is best, I will certainly do it.

To Petr's post; I have four folders with video, Home Video, Movies, Video, and YouTube (I have a program that downloads stuff from YouTube). Each of these folders has subdirectories that contain avi, mp4, mpg, and mpeg files. I use VLC to play them.

As a start, I am thinking of the following tags; name of the video clip, B/W or color, length of clip, type of clip (home movie, war movie, computer tutorial video, etc.). So I believe I will certainly need a search and sort capability (bubble sort - cuz I easily understand that one!).

Mike

6
QB64 Discussion / Re: File already open errors
« on: June 21, 2020, 09:53:27 pm »
Well, I had it happen again today. The program was running fine and all of the sudden it started to show up. Hold on - stop the presses. I think I found my error. So I open a file for input, read the data. If there is some data missing, then I would have reached an EOF. Since the data is missing, I stop further processing and go to the next file to process. But it seems I neglected to Close the previously opened file! I am so stupid sometimes! Well I just added some preemptive safeguarding code to the start of each block of file loading and processing to Close the file number just in case. Mike

7
QB64 Discussion / Re: Windows Task Sceduler
« 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

8
QB64 Discussion / Re: Windows Task Sceduler
« 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

9
QB64 Discussion / Re: Windows Task Sceduler
« 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

10
Programs / Re: Television by Sierraken and B+
« on: June 19, 2020, 10:08:49 pm »
You know, along similar lines, I was thinking of writing a program that would have a list of all of my videos and movies, in sort of a database arrangement, then you could search by title ot some sort of tagging, and then have it kick off VLC to play the movie. Any thoughts? Mike

11
QB64 Discussion / 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


12
QB64 Discussion / Re: File already open errors
« on: June 15, 2020, 05:08:07 pm »
So far so good, without errors, since I excluded the files from A/V scanning. I'm in the process of fixing some math errors, and then I want to move some of the program constants to a disk file that can be read at the start of the program. Then I plan on posting to code for comment. Thanks again, Mike

13
QB64 Discussion / Re: File already open errors
« on: June 13, 2020, 09:44:59 pm »
Thanks Petr. I think part of my problem is that I used "GOTO Loop1" and not "RESUME Loop1". I was reading through the QuickBASIC Bible when I realized I should have used RESUME. I don't think the "file already open error" is coming from my program, since that file is only opened once in the program, and when the error occurs, it seems to be at different places in the program. The program reads about 2 dozen different files, but one at a time, and in a sequence; ie. open, read the data, close the file, manipulate the data, and then move on to the next one.

The problem occurs randomly and intermittently, and at different places in the program. Since the files begin to be read fairly quickly after the files are created (from a SHELL batch file), I am wondering if the files are flagged as opened due to the anti-virus program scanning them and they are not closed before my program wants to open and read them. I have excluded the entire folder from scanning by the AV program to see if that helps. But again, since it happens randomly and intermittently, it may be awhile before I am certain. Thanks, Mike

14
QB64 Discussion / Re: File already open errors
« on: June 10, 2020, 04:41:45 pm »
Oh, I forgot this question, if the first error is a "File already open" error, how can I test to see if the file shows open and then just post an error message in the program and loop until the file closes? Thanks, Mike

15
QB64 Discussion / File already open errors
« on: June 10, 2020, 04:39:37 pm »
IN the process of putting together this program to get stock data and display it, I use wGet to retrieve the data into a file, via a SHELL execution of a batch file, then I read the data from each file into the program. Every once and awhile I get errors of each of the file. Error 55 followed by error 62.

I thought it might be that the wGet/batch created files hadn't been closed, so I added a 30 second delay after the line that executes the SHELL command (SHELL _HIDE "CMD /C MoneywGet.bat"). But that hasn't seemed to work.

I also added an error handler routine (ON ERROR GOTO Errhandler)...

Code: QB64: [Select]
  1. Errhandler: 'error handler sub program line label
  2. LOCATE 126, 80: PRINT "Error"; ERR; "on program file line"; _ERRORLINE
  3. BEEP ' warning beep
  4. OPEN "LiveBigBoardErrorLog.txt" FOR APPEND AS #2
  5. 'RESUME NEXT ' moves program to code following the error.
  6. GOTO loop1

But that still posts the error popups, and it never really goes back to the beginning (Loop1), it just goes and displays the next error popup. Any thoughts on what I am doing wrong; or missing? Thanks, Mike

Pages: [1] 2 3 ... 5