logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

GETUSERFIELD expression for multiple QSO QSL Card Report
K8ZM
#1 Posted : Monday, November 15, 2021 1:45:40 AM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 503
Location: Mentor, OH

Thanks: 119 times
Was thanked: 179 time(s) in 160 post(s)
I have a QSL report that prints multiple QSO's on a single QSL card but I need to get userfield data to print for each QSO and dont know the syntax required for the expression. The multiple QSO part is easy for standard fields like Band, Mode, etc, the expression is just Band2 or Band3 or Mode2 or Mode3 for QSO's 2 and 3. What I need is to get data from a user defined field for antenna, the syntax for the expression I'm using is GETUSERFIELD("ANT:") and that works fine for the first QSO but what is it for the subsequent QSO's, GETUSERFIELD2("ANT:") or GETUSERFIELD("ANT:"2) ?? Tried both but its not grabbing the data so I'm missing something obvious. Maybe I should be using Tag_Val instead ??

Thanks for any help....

Brad, K8ZM


Update: Tried Tag_Val("ANT:",userfield2) and that worked so will use that example expression unless there is way to get GETUSERFIELD("ANT:") to work.

Brad
Sponsor
Note: We receive a commission from Amazon when you purchase via this link. It does not affect your cost. Thank you!
WN4AZY
#2 Posted : Monday, November 15, 2021 12:39:20 PM(UTC)
admin

Rank: Administration

Groups: Administrators, Beta Testers
Posts: 3,057
Man
Location: Auburn, GA

Thanks: 969 times
Was thanked: 484 time(s) in 399 post(s)
Hi Brad:

Yeah, GETUSERFIELD() only reads USERFIELDS. It cannot be made to read USERFIELDS2, 3, etc. So stick with

Tag_Val("ANT:",userfield2)

Actually, with LOGic 10, it is a bit more complicated. There is now a second userfields field to handle more data. The contents of the first field spill over into the second field after it fills up. (Max size of each field is 254.) So you want to do this:

Tag_Val("ANT:",userfields+userflds2) && main record
Tag_Val("ANT:",userfield2+userflds22)
Tag_Val("ANT:",userfield3+userflds23)
Tag_Val("ANT:",userfield4+userflds24)
Tag_Val("ANT:",userfield5+userflds25)
Tag_Val("ANT:",userfield6+userflds26)
Tag_Val("ANT:",userfield7+userflds27)
Tag_Val("ANT:",userfield8+userflds28)

GETUSERFLD() has been updated to include the new USERFLDS2 in LOGic 10.

Tnx & 73,

Dennis WN4AZY
1 user thanked WN4AZY for this useful post.
K8ZM on 11/15/2021(UTC)
K8ZM
#3 Posted : Monday, November 15, 2021 2:47:12 PM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 503
Location: Mentor, OH

Thanks: 119 times
Was thanked: 179 time(s) in 160 post(s)
Thanks Dennis !!

I forgot about the new 2nd userfield !! So I should change all my GETUSERFIELD expressions to Tag_Val and follow your example expressions ....userfield2+userflds22 (etc, etc) ??

Also I want to print text, for example "None", if userfield ANT is empty (or userfield2,3, etc if multiple QSO's exist), should I just use an iif statment or is there a simpler way ?

One last question, when I'm in the expression builder and I enter Tag_Val("ANT:",userfields2) and hit the Verify radio button it always comes back with an error that userfield2 doesn't exist. It does work when I exit the report writer and run the report, its just when building the expression while in the report writer and It won't let me preview the report. I'll try to grab a screen shot when I'm in it again and post it.

Thanks as always,

Brad
WN4AZY
#4 Posted : Monday, November 15, 2021 4:46:27 PM(UTC)
admin

Rank: Administration

Groups: Administrators, Beta Testers
Posts: 3,057
Man
Location: Auburn, GA

Thanks: 969 times
Was thanked: 484 time(s) in 399 post(s)
Quote:
So I should change all my GETUSERFIELD expressions to Tag_Val and follow your example expressions ....userfield2+userflds22 (etc, etc) ??
Yes.

Quote:
Also I want to print text, for example "None", if userfield ANT is empty (or userfield2,3, etc if multiple QSO's exist), should I just use an iif statment or is there a simpler way ?
Or ICASE. No easier though. Exactly the same, except that you could do more than two conditions with ICASE if you wanted to. With two conditions, it is exactly the same. I just KISS and use ICASE all the time now.

The error is technically correct. USERFIELD2, USERFLD22, etc. does not actually exist until you run the report. Can't preview either. Sorry.

Tnx & 73,

Dennis WN4AZY
K8ZM
#5 Posted : Wednesday, November 17, 2021 12:24:48 AM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 503
Location: Mentor, OH

Thanks: 119 times
Was thanked: 179 time(s) in 160 post(s)
Got it, I think...seems over the years I have used GETUSERFIELD all over the place, also I should check the contest logforms as they may have some embedded expressions looking in or copying forward USERFIELDS data.

So, if I get this right, GETUSERFIELD still works but is only looking in USERFIELDS, new in LOGic 10 is GETUSERFLDS which will only look in the new USERFLDS. If USERFIELDS never exceeds the 254 character limit there will not be anything in USERFLDS, if it does then USERFLDS has an additional 254 character limit for "spill-over". In your example above regarding my multiple QSO QSL Card report the expression for the first QSO was " Tag_Val("ANT:",userfields+userflds2) && main report ". Is the && main report necessary ?? I think its just saying to look in the main report for the Tag_Val, so is this needed in every Tag_Val expression looking in both userfield and userflds ?? I got syntax errors and just left it out of the expression when I was using IIF or ICASE and so far it seems to work.

I missed the fact that those values don't exist till the report runs.....Ha....its been quite awhile since I was seriously playing in the report writer but now its starting to come back !!

73, Brad







WN4AZY
#6 Posted : Thursday, November 18, 2021 9:52:06 AM(UTC)
admin

Rank: Administration

Groups: Administrators, Beta Testers
Posts: 3,057
Man
Location: Auburn, GA

Thanks: 969 times
Was thanked: 484 time(s) in 399 post(s)
Hi Brad:

GetUserField() works with LOGic 10, and does consider both Userfields and Userflds2. So no problem with it at all.

The same old problem exists with GetUserField() as before. It cannot work with multiple-type reports. So no change here either really. The only change is that when you use Tag_val(), you have to pass both userfields to it.

Note that GetUserField() WILL work with reports that are not Multiple. And will work with no change between 9 and 10. The only issue is that GetUserField() will not work for fields that are not named USERFIELDS and USERFLDS2. That is why it won't work for mutiple-type reports. (You could actually use it for the first label, but that just further confuses things IMO.)

Hope that all makes sense 🙂.

Quote:
Is the && main record necessary ??
No. It is just a comment.

Tnx & 73,

Dennis WN4AZY
1 user thanked WN4AZY for this useful post.
K8ZM on 11/18/2021(UTC)
K8ZM
#7 Posted : Thursday, November 18, 2021 3:49:39 PM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 503
Location: Mentor, OH

Thanks: 119 times
Was thanked: 179 time(s) in 160 post(s)
Ok...perfectly clear now !!

Thanks, for some reason it didn't sink in the first time Huh ..hihi !

Brad, K8ZM
1 user thanked K8ZM for this useful post.
WN4AZY on 11/19/2021(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.033 seconds.