ChrisO was long gone by the time I came around, but it is obvious to the most casual observer that he was a tremendous asset and a real Access Heavyweight.searching Chris's stuff is both nostalgic and extremely educational!
That does not make sense at all. In an unhandled error all variables reset throughout the application. So in your example all those variables reset too. Only tempvars do not.I know but doesn't user-defined type reset because of an un-handled error?
I think most people feel this way. Almost never see people modify a passed variable in a sub, although it is completely legitimate. I find it hard to debug and follow the logic. When i do this accidently it can make your head spin debugging. My guess is that is why VB now defaults to byval.Yes - I now how to do it, it just feels slightly wrong when I use arguments as byRef
I was able to download it.David,
I noticed that the sample database on that latest link can not be downloaded. It appears to be a feature not yet available?? It would be nice to have some of the ChrisO gems/sample dbs available in newer version of Access.
so does that mean anyone building VB aps has to check all the code when recompiling?I think most people feel this way. Almost never see people modify a passed variable in a sub, although it is completely legitimate. I find it hard to debug and follow the logic. When i do this accidently it can make your head spin debugging. My guess is that is why VB now defaults to byval.
I do not understand the question. The default is simply byval. Not sure what that has to do with recompiling.so does that mean anyone building VB aps has to check all the code when recompiling?
I do not understand the question. The default is simply byval. Not sure what that has to do with recompiling.
![]()
Just saw this, you must have added it in an edit. I'll try and raise it with the tech team over there.This is the error message I got when trying to download the A97 file from UA.![]()
Go on Pat, gives us a few lines on REDEFINESThe link to the sample by @MajP is more aligned with how I would use a UDT than the sample by ChrisO which shows multiple occurrences of a single item.
The one piece of COBOL that i actually miss is the natural use of what VBA calls a UDT. Here's an example that UDT solves although I'm not sure you can get an array in also the way this does. the numbers show the hierarchy. This is a record layout and the 01 level lets you reference the entire record as a string and move it around or pass it to a different procedure. The Pic() clauses define the data type. In this case, they are some text and some integers. You can refer to SCF-Last-UPDT-YYMMDD or to just the month part of the field. The array is two dimensional in the sense of VBA arrays because each of the 31 instances is broken down into multiple fields. But is one dimensional in the COBOL would. You would need a subordinate OCCURS clause to have multiple dimrnsions. When you define the array, you also assign a variable name as the index. You use the same syntax as VBA to reference it. SCF-START-HHMM (SCF-DAY-IDX)
Code:000100 01 SCF-SCHEDULE-REC. 000200 05 SCF-KEY. 000300 10 SCF-CUST-NUM PIC X(06). 000400 10 SCF-APPLICATION PIC X(08). 000500 10 SCF-BRANCH PIC X(06). 000600 10 SCF-EFFECTIVE-YYMM. 000700 15 SCF-EFFECTIVE-YY PIC 9(02). 000800 15 SCF-EFFECTIVE-MM PIC 9(02). 000900 05 SCF-LAST-UPDT-YYMMDD. 001000 10 SCF-LAST-UPDT-YY PIC 9(02). 001100 10 SCF-LAST-UPDT-MM PIC 9(02). 001200 10 SCF-LAST-UPDT-DD PIC 9(02). 001300 05 SCF-DAILY-GROUP OCCURS 31 TIMES 001400 INDEXED BY SCF-DAY-IDX. 001500 10 SCF-START-HHMI. 001600 15 SCF-START-HH PIC 9(02). 001700 15 SCF-START-MI PIC 9(02). 001800 10 SCF-STOP-HHMI. 001900 15 SCF-STOP-HH PIC 9(02). 002000 15 SCF-STOP-MI PIC 9(02). 002100 10 SCF-CSTART-HHMI. 002200 15 SCF-CSTART-HH PIC 9(02). 002300 15 SCF-CSTART-MI PIC 9(02). 002400 10 SCF-CSTOP-HHMI. 002500 15 SCF-CSTOP-HH PIC 9(02). 002600 15 SCF-CSTOP-MI PIC 9(02). 002700 10 SCF-SEVERITY-CODE PIC 9(01).