PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 10
 1 
 on: January 19, 2020, 09:33:40 PM 
Started by Bumblebee - Last post by José Roca
> Do all these functions support unicode?

Indeed. Everything in my framework is unicode aware.

 2 
 on: January 19, 2020, 04:37:51 PM 
Started by Bumblebee - Last post by Bumblebee
Ideally, I would select unicode replacements that return boolean True.
Do all these functions support unicode?

 3 
 on: January 19, 2020, 04:17:06 PM 
Started by Bumblebee - Last post by José Roca
They don't return incorrect results. There are some functions, named like the FB ansi functions but with the Afx prefix,  that return 0 on success for compatibility with the intrinsic FB functions, and there are others with different names that return True on success.

AfxName returns 0 on success for compatibility with FB's NAME function, but AfxRenameFile returns a boolean True or False.

 4 
 on: January 19, 2020, 03:37:02 PM 
Started by Bumblebee - Last post by Bumblebee
dim shared y as integer

;
  Mirror backup  01-19-2020  15:17:18
  --------------------------------------------------
  C:\Decoy > E:\Decoy
  --------------------------------------------------
  Create folder  E:\Decoy\download [-1]
         Update  E:\Decoy\Software\fb\backup.bas [ 0 ]
         Update  E:\Decoy\Software\fb\backup.exe [ 0 ]
   Empty folder  E:\Decoy\hello
  File moved to  E:\Decoy\download\Aquarius.jpg [ 0 ]
  File moved to  E:\Decoy\download\Athena.jpg [ 0 ]
  File moved to  E:\Decoy\download\bartlett.jpg [ 0 ]
  File moved to  E:\Decoy\download\crow.jpg [ 0 ]
  File moved to  E:\Decoy\download\crows in cemetary.jpg [ 0 ]
  File moved to  E:\Decoy\download\current.alm [ 0 ]
  File moved to  E:\Decoy\download\fantasy map.map [ 0 ]
  File moved to  E:\Decoy\download\Fool's Proof.jpg [ 0 ]
  File moved to  E:\Decoy\download\Gwhendolyn.gif [ 0 ]
  File moved to  E:\Decoy\download\Helena.png [ 0 ]
  File moved to  E:\Decoy\download\kayla-maurais-Vsllwfgk4yw-unsplash.jpg [ 0 ]
  File moved to  E:\Decoy\download\misc.txt [ 0 ]
  File moved to  E:\Decoy\download\Stereo Songweaver.jpg [ 0 ]
  File moved to  E:\Decoy\download\Summer Of The Fire Ship.jpg [ 0 ]
  File moved to  E:\Decoy\download\tcovrc.jpg [ 0 ]
  File moved to  E:\Decoy\download\abc.gif [ 0 ]
   Erase folder  E:\Decoy\hello [-1]

¯\(º_º)/¯                   ¯\(º_º)/¯

 13982 files processed. Backup complete.


AfxName returns 0 on success
AfxMakeDir/AfxMkDir returns -1 on success
AfxRemoveDir/AfxRmDir returns -1 on success

Whether I use a boolean or integer variable, the returned value for some of the functions is incorrect.
As it stands now, the documentation is partially incorrect.

I can work around this, but why aren't the return codes consistent?

 5 
 on: January 19, 2020, 02:32:36 PM 
Started by Bumblebee - Last post by José Roca
Both AfxFileCopy, AfxKill and AfxName are unicode replacements for FreeBasic FileCopy and Name functions, and return the same values that the functions that they replace.

For functions that return true instead of false, use AfxCopyFile, AfxDeleteFile and AfxRenameFile.

As stated in the documentation:

AfxMkDir is an unicode replacement for Free Basic's MkDir and returns 0 on success, or -1 on failure.
AfxKill is an unicode replacement for Free Basic's Kill and returns 0 on success, or -1 on failure.
AfxName is an unicode replacement for Free Basic's Name and returns 0 on success, or non-zero on failure.
AfxRmDir is an unicode replacement for Free Basic's RmDir and returns 0 on success, or -1 on failure.



 6 
 on: January 19, 2020, 11:29:05 AM 
Started by Bumblebee - Last post by Bumblebee
If my understanding is correct, the Afx file procedures listed below should return true upon each successful file operation.
As it stands, variable y only returns true for AfxMakeDir and AfxKill. The other functions return false even though their disk operations were successful.
What am I doing wrong?

Relevant code excerpt:

Code: [Select]
dim shared as CWSTR c,d,rm(),m
dim shared y as Boolean
dim shared g as Integer

select case g
  case 1 : y = AfxMakeDir (d)
  case 2 : y = AfxFileCopy (c,d)
  case 3 : y = AfxName (c,d)
  case 4 : y = AfxKill (c)
  case 5 : y = AfxRemoveDir (d)
end select
if y = false then print "Error ^"

Edit: I forgot to test AfxRemoveDir... it also returns true.
Here is the output from a test of all five functions:

;
  Mirror backup  01-19-2020  12:20:57
  --------------------------------------------------
  C:\Decoy > E:\Decoy
  --------------------------------------------------
  Create folder  E:\Decoy\hello [true]
         Update  E:\Decoy\Software\fb\backup.bas [false]
         Update  E:\Decoy\Software\fb\backup.exe [false]
   Empty folder  E:\Decoy\download
  File moved to  E:\Decoy\hello\Aquarius.jpg [false]
           Copy  C:\Decoy\hello\Athena.jpg [false]
  File moved to  E:\Decoy\hello\bartlett.jpg [false]
  File moved to  E:\Decoy\hello\crow.jpg [false]
  File moved to  E:\Decoy\hello\crows in cemetary.jpg [false]
  File moved to  E:\Decoy\hello\current.alm [false]
  File moved to  E:\Decoy\hello\kayla-maurais-Vsllwfgk4yw-unsplash.jpg [false]
  File moved to  E:\Decoy\hello\misc.txt [false]
           Copy  C:\Decoy\hello\abc.gif [false]
           Copy  C:\Decoy\Software\fb\crow.exe [false]
         Delete  E:\Decoy\download\abc.gif [true]
   Erase folder  E:\Decoy\download [true]
¯\(º_º)/¯                   ¯\(º_º)/¯

 13998 files processed. Backup complete.

 7 
 on: January 19, 2020, 09:24:57 AM 
Started by Steven Hua - Last post by Steven Hua
Thanks Paul !

 8 
 on: January 16, 2020, 01:09:02 PM 
Started by SeaVipe - Last post by raymw
It seems that oddrowcolor over-rides any background colour that I try to set for an individual row (but foreground colours can be changed as desired). Wrt grid line colour, they are very faint in some circumstances.

 9 
 on: January 16, 2020, 09:35:00 AM 
Started by SeaVipe - Last post by raymw
Thanks, Paul.  colors.systemhighlight works OK

 10 
 on: January 16, 2020, 08:13:18 AM 
Started by Eigil Dingsor - Last post by Eigil Dingsor
Thank you again Josè,
Think I'll proceed with the CDispinvoke class. Less code and less verbose than my initial approach. The XMLHTTP communication is just a small part of my code.
Eigil

Pages: [1] 2 3 ... 10