How to zero var image easily.
Kye
Posts: 2,200
So... I have a really large VAR section that contains 198 longs.
I want to do just "longfill(@diskSignature, 0, 198)".
Can I assume that the SPIN compilier will not cause me to have problems by doing this? I know its bad coding style to write across variables like that but.... there are alot of variables and clearing each manually is too much.
VAR ' DO NOT REARRANGE - MUST BE A 198 LONG ARRAY WHOSE STARTING ADDRESS IS "diskSignature"! long diskSignature, volumeIdentification, fileSystemType long dataSectors, countOfClusters, partitionStart, partitionSize, FATSectorSize long rootDirectorySectorNumber, firstDataSector, rootCluster, freeClusterCount, nextFreeCluster long currentCluster, currentSector, currentByte, previousCluster, previousSector, previousByte long currentDirectory, currentFile, fileSize, filePosition word currentTime, currentDate, reservedSectorCount, rootDirectorySectors, fileSystemInfo, backupBootSector byte mountedUnmountedFlag, errorNumberFlag, fileOpenCloseFlag, fileReadWriteFlag byte sectorsPerCluster, numberOfFATs, mediaType, externalFlags byte cleanShutdown, hardError, workingDirectoryPathIndex, workingDirectoryTooDeep byte dataBlock[512], directoryEntry[32], directoryEntryName[12], workingDirectoryPath[66] byte volumeLabel[12], cardUniqueIDCopy[17], unformatedNameBuffer[13], formatedNameBuffer[12]
I want to do just "longfill(@diskSignature, 0, 198)".
Can I assume that the SPIN compilier will not cause me to have problems by doing this? I know its bad coding style to write across variables like that but.... there are alot of variables and clearing each manually is too much.
Comments
--Terry
Not related to your question but I must commend you on using totally readable var names that actually give a hint as to it's purpose. Wish all authors would follow your lead.
Well done.
Mike B.
For the record: