Daily Challenge Day 17

Dialects of Basic

More work on attempting to translate my structural technical library from MS Excel/vba to LibreOffice Basic (LoB) and FreeBasic.

Current problem is array initialisation. Freebasic doesn’t have the array function, but allows arrays to be initialised when declared. To simplify file comparison when using “beyond compare”, I rearranged the vba module so that the variable declarations were above each subroutine which set the values. Turns out that whilst can typically declare a variable as needed: at module level all variables need to be declared above function and subroutine definitions. Which I kind of knew already but rediscovered. If “option explicit” is not set, then the module will run but intellisense cannot find variable definitions.

So at the moment attempting to break vba modules up, so that can convert some into include files (.bi) for use in FreeBasic. Though since type definitions cannot be public in LoB, modules will have to be combined for use with LibreOffice.

Will have to rewrite my VBScript which generates the .bi files, as it overwrote the previous files which had greater content than just function headers. Script could be extended to cut the vba files up for use with FreeBasic, and combine the vba files for use with LoB.

Anycase the main problem at the moment is to better organise the array declarations and initialisations.


Last night took another look at Git, and found the following two interesting articles:

  1. The git parable
  2. A curious tale

It seems if I used git I wouldn’t have a problem with multiple copies of the same file. On the other hand it does have the typical problems of archive software:

  1. Encrypted files
  2. Compressed files

These are problems because without the correct software, the files are basically lost. I’ve never liked archive or backup software, not on tapes and not on disks, nor do I like built-in backup commands in application software. My general experience is that when encounter problems the source of the problem also affects the backup software: and consequently cannot recover using the backup. Flashy backup systems which can span across multiple disks are almost guaranteed not to be recoverable.

So generally found, the safest process, is to simply backup, by copying files to external storage, using the copy command built-in to the operating system.

Any case Git is about more than backup. None of the examples discussed the working folder having subdirectories: I’m guessing that each subfolder would require its own git settings.

Also I haven’t yet checked that a spreadsheet once placed in the repository is capable of being retrieved and still operational.