I have just started “refactoring” a previously working application and have discovered a way of throwing the IDE into a version of the odd state that I mention.
I believe that the issues are triggered because I have a new function that has no “return”.
The application is designed to import images from a memory card into a folder structure on a hard drive. When a folder or volume is drag dropped onto a graphic the action triggers a call to a handler to list all files. The list files handlers are being updated to make them more robust and involve replacing older code with newer extracted from other working applications. Here is the handler that is called and is missing the “return”.
function getAllFiles pStartFolder
# This function is called from the UI and calls the two handlers that
# list all the folders and than then all the files in the folders
# These updated versions use the 'detailed UTF' version of the folder and file names
put getAllFolders(pStartFolder) into tFolderList
repeat for each line aFolderPath in tFolderList
put getAllFilesInFolder (pFolder) & cr after tFileList
end repeat
end getAllFiles
“getAllFolders” lists all the folders below pstartfolder using non-recursive code originally written by Bernd and posted on the LC forum. I am posting the code because someone is bound to ask for it.
function getAllFolders, pStartFolder
## Routine that reads the folder tree below pStartFolder
local tOldDefault, tFolderRootSearch, tTime, tCollector, tAllFiles, doAllTheseFiles, tFolderArray, tFoldersToSearch
--put the defaultfolder into tOldDefault
put pStartFolder into tFolderRootSearch
--put the milliseconds into tTime
## begin of search for subfolders
put "" into tFolderArray
put 1 into tFolderArray[tFolderRootSearch]
local tLookForMoreFolders, tFoldersTemp, tSubTemp, tList, tListofFolders
repeat -- will exit when no more folders are found see tFoldersToSearch
put "" into tFoldersToSearch
put the keys of tFolderArray into tLookForMoreFolders
repeat for each line aFolder in tLookForMoreFolders
if tFolderArray[aFolder] is not "" then put aFolder & cr after tFoldersToSearch
put "" into tFolderArray[aFolder] -- so next time this path will not be searched
end repeat
# Exit the repeat loop when there are no more folders
if tFoldersToSearch is "" then exit repeat -- no folder found that has not been looked at
# Process the folders that have been found
repeat for each line aFolder in tFoldersToSearch
set the defaultfolder to aFolder
put "" into tFolderArray[aFolder] -- so next time this path will not be searched
### New code TO USE detailed-UTF
--put the folders into tFoldersTemp --old
put empty into tFoldersTemp
put (the detailed folders) into tList
repeat for each line aline in tList
--put item 1 of aline & cr after tFoldersTemp
put textDecode(URLDecode(item 1 of aLine),"utf8") & cr after tFoldersTemp
end repeat
delete the last char of tFoldersTemp
# tFolderTemp should now be more robust
# filter out operating system folders on mac (like "..", or starting with "." to make it invisible)
filter tFoldersTemp without ".*"
-- filter without application folders, on the mac application may be pakages
filter tFoldersTemp without "*.app"
# Check if loop should move onto next folder (aFolder)
if tFoldersTemp is "" then next repeat
repeat for each line aSubFolder in tFoldersTemp
put aFolder & slash & aSubFolder into tSubTemp
put 1 into tFolderArray[tSubTemp] -- next time this path will be searched, at the same time the path is a new key in the array
end repeat
end repeat -- exits when the list of folders has been processed
end repeat -- exits when no more folders are found
put the keys of tFolderArray into tListofFolders
sort tListofFolders
## sort using a count of the slashes counted by function FolderDepth
## the decending command ensures the deepest folders are listed first
sort lines of tListofFolders descending by FolderDepth(last item of each)
return tListofFolders
end getAllFolders
function getAllFilesInFolder, pFolder
local tOldDefault, thePath, tList , tFilesInFolder, tFileSpecs
put the defaultfolder into tOldDefault --> save the original default folder
put pFolder into thePath
# now get all the files and the filepaths
set the defaultfolder to thePath
put (the detailed files) into tListFileDetails
put empty into tFilesInFolder
repeat for each line aFileDetail in tListFileDetails
set the cursor to busy -- spins a bit further
# item 2 is the size of the file in bytes
put textDecode(URLDecode(item 1 of aFileDetail),"utf8") & cr after tFilesInFolder
end repeat
delete the last char of tFilesInFolder
filter tFilesInFolder without ".*"
put "jpeg,jpg,tif,tiff,dng" into tValidExtensions
if tFilesInFolder is not "" then
repeat for each line aFile in tFilesInFolder
set the cursor to busy -- spins a bit further
put GetFileExtn(aFile) into tExtn
if tExtn is among the items of tValidExtensions then
put thePath & slash & aFile & return after tFileSpecs
end if
end repeat
end if
--delete last char of tFileSpecs -- return character
set the defaultFolder to tOldDefault -- housekeeping
return tFileSpecs --> list of full filespec,filesize
end getAllFilesInFolder
When getAllFiles is called it fails to return. I have placed a breakpoint in the calling handler which stops the code as expected. At this point the IDE is not working as it should: it is not possible to inspect variables by double clicking on them and it is not possible to grab the boundary between script and variables and change its size. I have taken a screen video of the issue; where you see the mouse over variables are the resize control I am I am attempting to get them to work.
Screen Recording 2026-08-06 at 07.32.29.zip (6.9 MB)
The recording has to be short to enable it to be posted but what does not come across is that other parts of the IDE are still working. I am able to edit code, apply and run it. So to be clear the IDE has not fully locked up but some normal operations no longer work. I am interested if your copy of HyperXtalk exhibits the same strangeness.
IngestImages_DNG_Workflow.hyperXtalk.zip (272.6 KB)
The stack file has the error I describe above and probably a few more as yet undiscovered.
Simon