Hello, Within a macro, you may want to save a file somewhere without hard-coding the folder path. This short macro CSIDL will create a list of the paths to the Windows "Special Folders" that can be used for reference. The list is stored on the Windows clipboard as well as in C:\Users\<user name>\Desktop\CSIDL Values.TXT. The INDEX column indicates the index number used in the OS_GetSpecialFolder(i) function. In the thinBasic help file there is a list of OS Equates that can be used for specific folders, but it isn't always clear exactly what the real path is. Cheers, Terry
Terry, perhaps you could do some research and figure out the relationship between the index numbers and what they represent. There are probably #include files in the Microsoft SDK libraries (somewhere) that describe what all these numbers mean.
George, Robert, Power Basic appears to be more up to date than thinBasic. Apparently, Microsoft has superseded CSIDL with KNOWNFOLDERID. Leaving that aside, for thinBasic, I compiled a cross reference of the decimal index values to the thinBasic symbols and the path returned for each. There is one error in the symbolic list from the OS Equates section of the thinBasic help file - the %CSIDL_FLAG_CREATE symbol resolves to the Desktop path, but the term CSIDL_FLAG_CREATE doesn't represent a folder so I wasn't able to determine what index value it represents. Also, there are 2 cases where the same path is returned for 2 different index values which may stem from whether the OS is 32 bit or 64 bit or even what version of Windows is in use.
Anyway, the left column contains the decimal Index, the second column contains the thinBasic OS Equate symbol and the third column contains the path returned by the OS_GetSpecialFolder() function.
Terry, I took a look at your attachment. This is a nice piece of work. Anyone writing macros and needing this information now has a great resource to use. Thanks for your efforts in putting this together.