Loading ...
Sorry, an error occurred while loading the content.

44201Re: [libertybasic] Re: veneffy - program causes exception error

Expand Messages
  • veneff@intouchmi.com
    Jan 1, 2012
    • 0 Attachment
      Stefan,

      Actually, the question I should have been asking, is the C type bool 16 or
      32 bits.

      Anyway, I think your function FindFiles seems to working. I did get an
      error keyNotFound (or something like that) one time, but I may have done
      something to cause it by ending the LB task prematurely because it was
      taking so long to run because the file list string was growing large while
      iterating that loop 1000 times. I'm going to restructure the original
      program so that the find first...next API calls occur together in the same
      routine. This will take some time but I'll let you know what I find.

      Why do you figure the problem was occurring?

      Vance

      > Am 01.01.2012 01:31, schrieb Stefan Pendl:
      >> Am 01.01.2012 01:12, schrieb veneff@...:
      >>> Stefan,
      >>>
      >>> Is boolean a 16 or 32 bit integer?
      >>>
      >>> I changed the 3 occurances of AS BOOLEAN to AS LONG.
      >>> Still similar results.
      >>>
      >>> When I ran with the changes I got the error:
      >>> MessageNotUnderstood
      >>>
      >>> I closed LB and restarted and reran with the same results.
      >>> I did the same but ran the Debug with animation getting the error:
      >>> a non-continuable protection violation has occurred. Check ERROR.LOG
      >>> file.
      >>> The error log just shows the same error with a register dump.
      >>> At this point, when I rerun the program I get the non-continuable...
      >>> error.
      >>> I have to reboot in order to get the MessageNotUnderstood error.
      >>>
      >>
      >> See the code below for the size of the data types in LB.
      >>
      >> The best translation table between C and LB can be found at
      >> http://www.b6sw.com/forum/content.php?mode=hints&t=235
      >>
      >>
      >
      > Does the following function work?
      >
      > '---code start (watch for line wraps)
      >
      > function FindFiles(Path$, ByRef Found$)
      > ' searches for the given file or folder
      > '
      > ' fills Found$ with the list of found files or folders
      > ' separated by ;
      > '
      > ' returns the number of files or folders found
      >
      > struct Win32FindData, _
      > FileAttributes as ulong, _
      > CreationTimeLow as ulong, _
      > CreationTimeHigh as ulong, _
      > LastAccessTimeLow as ulong, _
      > LastAccessTimeHigh as ulong, _
      > LastWriteTimeLow as ulong, _
      > LastWriteTimeHigh as ulong, _
      > FileSizeHigh as ulong, _
      > FileSizeLow as ulong, _
      > Reserved0 as ulong, _
      > Reserved1 as ulong, _
      > FileName$ as char[260], _
      > AlternateFileName$ as char[14]
      >
      > calldll #kernel32, "FindFirstFileA", _
      > Path$ as ptr, _
      > Win32FindData as struct,_
      > handle as ulong
      >
      > if handle = _INVALID_HANDLE_VALUE then
      > FindFiles = 0
      > else
      > do
      > if Found$ = "" then
      > Found$ = Win32FindData.FileName$.struct
      > else
      > Found$ = Found$; ";"; Win32FindData.FileName$.struct
      > end if
      > FindFiles = FindFiles + 1
      >
      > calldll #kernel32, "FindNextFileA",_
      > handle as ulong,_
      > Win32FindData as struct,_
      > result as long
      > loop until result = 0
      >
      > calldll #kernel32, "FindClose", _
      > handle as ulong, _
      > result as long
      > end if
      > end function
      >
      > '---code end
      >
      > --
      > Stefan Pendl
      > http://stefanpendl.runbasichosting.com/
      >
      > LB 4.04 Pro ... http://www.libertybasic.com/assist.html
      > LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe
      >
      > LB Community Wiki .............. http://basic.wikispaces.com/
      > LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
      > LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/
      >
      > Books at http://www.lulu.com/ and http://www.amazon.com/
      > Alyce Watson ... APIs for Liberty BASIC
      > Carl Gundel .... Beginning Programming with Liberty BASIC
      >
      > Windows 7 Home Premium 64-bit SP1
      > AMD Turion X2 RM-70 2GHz, 4GB RAM
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Show all 11 messages in this topic