Probably a dumb question

125 views
Skip to first unread message

Jackson Ramos

unread,
Jan 10, 2022, 10:26:28 AM1/10/22
to Pick and MultiValue Databases
I need a program, that takes an input, that if the program receives a "?" as input it would print out a description of what the program is asking for. Now do i use an if statement or case statements, I've tried print statements but that doesn't seem to work. Any help?



Thanks 
Jackson

Jackson Ramos

unread,
Jan 10, 2022, 10:28:33 AM1/10/22
to Pick and MultiValue Databases
My mistake I've tried printing on screen with print statements using the if statement but it doesn't seem to work. I Must be doing something wrong.

Nathan Rector

unread,
Jan 10, 2022, 10:32:20 AM1/10/22
to mvd...@googlegroups.com

Is this what you are trying to do?

INPUT VALUE

IF (VALUE = "?") THEN

  PRINT "QUESTION MARK FOUND"

END

If PRINT doesn't display the screen, then somewhere before the input a PRINTER ON or SP-ASSIGN was likely issued.   You can always print to screen by use:

CRT "QUESTION MARK FOUND"

instead of

PRINT "QUESTION MARK FOUND"

-Nathan

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/998b8cb0-8ff2-446e-a3b1-5f5cb2c1ffbfn%40googlegroups.com.
-- 
--------------------------------------------
Nathan Rector
International Spectrum, Inc
http://www.intl-spectrum.com
Phone: 720-259-1356

Jackson Ramos

unread,
Jan 10, 2022, 10:38:22 AM1/10/22
to mvd...@googlegroups.com
It looks more like 

CRT @(0,23):@(-4):"PROGRAM PROMPT: "
CALL SUBROUTINE(DESC)

And tired IF DESC = "?" THEN CRT "DESCRIPTION OF PROGRAM"


Steve Trimble

unread,
Jan 10, 2022, 12:32:43 PM1/10/22
to mvd...@googlegroups.com
Jackson - based on what you are showing, you need to:
EDit the program named 'DESC'
in that program, you should see 'INPUT xxx' --> (xxx) being a variable being set
after that INPUT, then you can:
IF XXX[1,1] = "?" THEN CRT "DESCRIPTION OF PROGRAM" ; GOTO 'back to input'

CRT @(0,23):@(-4):"PROGRAM PROMPT: "
CALL SUBROUTINE(DESC)

Computerized Data Mgmt Inc
Steve Trimble
(501) 772-3450 cell / text


Jackson Ramos

unread,
Jan 10, 2022, 12:35:57 PM1/10/22
to mvd...@googlegroups.com
desc is variable,
call subroutine(desc) was just an example the real code reads CALL GET.INPUT(DESC)

geneb

unread,
Jan 10, 2022, 1:09:01 PM1/10/22
to Pick and MultiValue Databases
Jackson, can you paste in a snippet of code so I can see what you've got
so far?

tnx.

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby. Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!

Steve Trimble

unread,
Jan 10, 2022, 1:10:59 PM1/10/22
to mvd...@googlegroups.com
ok, then right after CALL GET.INPUT(DESC)
insert:
CRT "desc ":DESC
then you can determine what GET.INPUT is returning
so, you can then say:
IF DESC[1,1] = "?" THEN .....

if you want to interrupt in the program 'GET.INPUT' then put the 
IF DESC[1,1] = "?" THEN ..... in the program 'GET.INPUT'

Computerized Data Mgmt Inc
Steve Trimble
(501) 772-3450 cell / text

Jackson Ramos

unread,
Jan 10, 2022, 1:12:04 PM1/10/22
to mvd...@googlegroups.com

007     CL=@(-4); CS=@(-1)
008     OPEN '','PROPOSALS' TO PROPF ELSE STOP "201","PROPOSALS"
009 * ASKS USER TO INPUT PROPOSAL DESCRIPTION ON MENU SCREEN
010 000 CRT @(0,23):CL:"Proposal description: ":
011     CALL GET.INPUT(DESC)
012 009 IF DESC="END" THEN STOP
013     IF LEN(DESC)<3 THEN GOTO 000
014     PROP.NOS=""
015 * LOADS INFORMATION RELATING TO THE PROPOSALS, USING THE JOB NAME(DESCRIPTI
    ON)
016     CRT @(0,22):CL:"Working...":
017     EXECUTE 'SSELECT PROPOSALS # "C]" WITH JOB-NAME = "[':DESC:']"' CAPTURI
    NG XX
018     LOOP
019        READNEXT PROP.NO ELSE EXIT
020        PROP.NOS<-1>=PROP.NO
021     REPEAT
022     IF DESC = "?" THEN CRT "4 LETTER WORD OR MORE DESCRIBING THE PROPOSAL"
023     NUM.PROPS=DCOUNT(PROP.NOS,AM)
024 * DISPLAYS HOW MANY PROPOSALS ARE ON FILE FOR THE DESCRIPTION INPUTTED, ON
    FIRST PAGE
025     IF NUM.PROPS ELSE
026        CRT @(0,22):CL:'No PROPOSALS "':DESC:'" on file.'
027        GOTO 000
028     END

.

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.

geneb

unread,
Jan 10, 2022, 1:19:43 PM1/10/22
to mvd...@googlegroups.com
Thanks Jackson.

I think the "IF LEN(DESC) < 3" is what is biting you.

Also, you might be better off in the log run to use text label instead of
numerics. It's kind of a self-documenting measure. For example,
"ask.proposal:" tells you exactly what that label target does, whereas
"000" is anyone's guess.

Jackson Ramos

unread,
Jan 10, 2022, 1:26:47 PM1/10/22
to mvd...@googlegroups.com
No thank you Geneb any feedback is well appreciated. I tried to remove the LEN but the program then runs as normal still no description shows up.



Thanks 
Jackson

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.

Wol

unread,
Jan 10, 2022, 1:30:06 PM1/10/22
to mvd...@googlegroups.com
On 10/01/2022 18:10, Steve Trimble wrote:
> ok, then right after CALL GET.INPUT(DESC)
> *insert*:
> CRT "desc ":DESC
> then you can determine what GET.INPUT is returning
> so, you can then say:
> IF DESC[1,1] = "?" THEN .....
>
Rather than DESC[1,1] (assuming that the input is supposed to be just a
question mark) I'd use TRIM(DESC). You're assuming they may accidentally
have typed garbage after the question mark, TRIM will remove anything
either side rather than just checking the first character.

Cheers,
Wol

Jackson Ramos

unread,
Jan 10, 2022, 1:39:11 PM1/10/22
to mvd...@googlegroups.com
Hey Steve,

It returns back whatever was inputted by the user. And I tried it your way but still the description still doesn't print onto screen. 

Thanks Jackson

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.

geneb

unread,
Jan 10, 2022, 1:56:23 PM1/10/22
to mvd...@googlegroups.com
On Mon, 10 Jan 2022, Jackson Ramos wrote:

> No thank you Geneb any feedback is well appreciated. I tried to remove the
> LEN but the program then runs as normal still no description shows up.
>
What does the contents of DESC look like right after the get.input() call?
Could it be eating the question mark character on you?

g.
Message has been deleted

Kevin Powick

unread,
Jan 10, 2022, 2:19:28 PM1/10/22
to Pick and MultiValue Databases

It's hard to tell from your code exactly what the flow should be, but the following cleans things up a bit -- No GOTOs and better modularization.
It compiles under D3, but it's  just a rough go based on little information. There is definitely room for improvement.

OPEN '','PROPOSALS' TO PROPF ELSE STOP "201","PROPOSALS"
*
CL=@(-4)
CS=@(-1)
A22 = @(0,22):CL
PROMPT ''
*
LOOP
GOSUB GET.DESC
IF DESC = "END" THEN EXIT
*
PROP.NOS = ""
GOSUB GET.PROPS
NUM.PROPS = DCOUNT(PROP.NOS,@AM)
IF NUM.PROPS > 0 THEN EXIT
REPEAT
STOP
*
*---SUBROUTINES-----------------------------------------------------
GET.DESC:
* ASKS USER TO INPUT PROPOSAL DESCRIPTION ON MENU SCREEN
LOOP
CRT @(0,23):CL:"Proposal description: ":
CALL GET.INPUT(DESC)
IF DESC = "END" OR LEN(DESC) > 3 THEN EXIT
IF DESC = "?" THEN
CRT A22:"4 LETTER WORD OR MORE DESCRIBING THE PROPOSAL"
END
REPEAT
RETURN
*
GET.PROPS:
* LOADS INFORMATION RELATING TO THE PROPOSALS, USING THE JOB
* NAME(DESCRIPTION)
CRT A22:"Working..."
STMT = 'SSELECT PROPOSALS # "C]" WITH JOB-NAME = "[':DESC:']"'
EXECUTE STMT RETURNING ERR RTNLIST PROP.LIST
IF ERR = 401 THEN
CRT A22:'No Proposals found with description: ':DESC
RETURN
END
LOOP
READNEXT PROP.NO FROM PROP.LIST ELSE EXIT
PROP.NOS<-1>=PROP.NO
REPEAT
RETURN

Steve Trimble

unread,
Jan 10, 2022, 2:23:29 PM1/10/22
to mvd...@googlegroups.com
Jackson - show us the code of "GET.INPUT"

Computerized Data Mgmt Inc
Steve Trimble
(501) 772-3450 cell / text

George Gallen

unread,
Jan 10, 2022, 2:28:17 PM1/10/22
to mvd...@googlegroups.com
just throwing this out there......

could the return of get.input be "" (blank)? vs "?"?
wondering if the input curser is a "?" and user thinks just hitting <enter> is sending a ? but in reality (or D3) it's blank.

you really need to put :   CRT LEN(DESC):"   ->":DESC:"<-" on the line after the call get.input
make sure you include the -> and <- so you know if there are leading/trailing spaces

George



From: mvd...@googlegroups.com <mvd...@googlegroups.com> on behalf of Steve Trimble <cdm...@gmail.com>
Sent: Monday, January 10, 2022 2:23 PM
To: mvd...@googlegroups.com <mvd...@googlegroups.com>
Subject: Re: [mvdbms] Re: Probably a dumb question
 

Jackson Ramos

unread,
Jan 10, 2022, 2:50:13 PM1/10/22
to Pick and MultiValue Databases
I figured it out guys the Desc = "end" was eating my question mark for whatever reason.

Jackson Ramos

unread,
Jan 10, 2022, 2:52:09 PM1/10/22
to Pick and MultiValue Databases
George,

I am currently using D3 so i'm pretty sure its blank.

Thanks

George Gallen

unread,
Jan 10, 2022, 2:55:13 PM1/10/22
to mvd...@googlegroups.com
Wasn’t saying reality and d3 would be different - just a play on reality both as a state of mind and as the OS dialect



On Jan 10, 2022, at 2:52 PM, Jackson Ramos <jackso...@qualco.com> wrote:

George,

Wol

unread,
Jan 10, 2022, 3:19:38 PM1/10/22
to mvd...@googlegroups.com
On 10/01/2022 19:50, Jackson Ramos wrote:
> I figured it out guys the Desc = "end" was eating my question mark for
> whatever reason.
>
Was it something like confusing = and == in C?

There's two ways round that. Standard advice is to always put the
literal before the variable if it's a logical test, eg

IF "end" = DESC THEN

but what I always do in BASIC (comes of being an old FORTRAN guy) is to
use the logical operators EQ, NE, GE, GT, LE, LT etc.

That way you don't let the compiler get it wrong ... :-)

Cheers,
Wol

chandru murthi

unread,
Jan 10, 2022, 3:26:44 PM1/10/22
to Pick and MultiValue Databases
Personally, I don't see how that was the problem. Your line 22 IF DESC = '?' could never be true because you havve checked at 12 for IF LEN(DESC) < 3, and then continued as if it's a valid description, including the Select, etc.
I think you have to move line 22 :
011     CALL GET.INPUT(DESC)
012 009 IF DESC="END" THEN STOP
           IF TRIM(DESC) = '?' THEN PRINT 'whatever'
013 IF LEN(DESC)<3 THEN GOTO 000

chandru murthi

unread,
Jan 10, 2022, 3:27:53 PM1/10/22
to Pick and MultiValue Databases
Personally, if I saw 'IF "END" = DESC THEN', I'd call for remedial training for that programmer. ;) .

chandru murthi

unread,
Jan 10, 2022, 3:30:48 PM1/10/22
to Pick and MultiValue Databases
PS, wol, Pick BASIC compilers never "get it wrong". '=' is always overloaded.

Wol

unread,
Jan 10, 2022, 3:46:26 PM1/10/22
to mvd...@googlegroups.com
Belt and braces.

It's a mistake that's easily made in C. There's a whole bunch of
languages that can't tell the difference between a function and a statement.

I've never known any Pick BASIC compiler get it wrong. But I let my
FORTRAN habits take over and make sure it doesn't get the opportunity :-)

Cheers,
Wol
>> ------------------------------------------------------------------------
>> *From:* mvd...@googlegroups.com
>> <mvd...@googlegroups.com> on behalf of Steve Trimble
>> <cdm...@gmail.com>
>> *Sent:* Monday, January 10, 2022 2:23 PM
>> *To:* mvd...@googlegroups.com <mvd...@googlegroups.com>
>> *Subject:* Re: [mvdbms] Re: Probably a dumb question
>> Jackson - show us the code of "GET.INPUT"
>>
>> *Computerized Data Mgmt Inc*
>> *Steve Trimble*
>> /(501) 772-3450 <tel:(501)%20772-3450> cell / text/
>> /cdm...@gmail.com/
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fmvdbms&data=04%7C01%7C%7C71c66adf352b4a08842608d9d472b1c9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637774411349225137%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Oey%2B462KrY1CnsEyRBl431NxeDzqrL19%2FrIF9jdlF84%3D&reserved=0>
>> ---
>> You received this message because you are
>> subscribed to the Google Groups "Pick and
>> MultiValue Databases" group.
>> To unsubscribe from this group and stop
>> receiving emails from it, send an email to
>> mvdbms+un...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mvdbms/e0daf14d-aded-0210-0649-591185dd9832%40youngman.org.uk
>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fmvdbms%2Fe0daf14d-aded-0210-0649-591185dd9832%2540youngman.org.uk&data=04%7C01%7C%7C71c66adf352b4a08842608d9d472b1c9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637774411349381394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=yA3ReHkJFK7tXMT3%2F9p%2BtsVHvsfHU8jFUqwnAYvYhTo%3D&reserved=0>.
>>
>> --
>> You received this message because you are
>> subscribed to
>> the "Pick and MultiValue Databases" group.
>> To post, email to: mvd...@googlegroups.com
>> To unsubscribe, email to:
>> mvdbms+un...@googlegroups.com
>> For more options, visit
>> http://groups.google.com/group/mvdbms
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fmvdbms&data=04%7C01%7C%7C71c66adf352b4a08842608d9d472b1c9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637774411349381394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=VfK1AfjKAdzuX2gY5KO4CKLM1Ja%2FNVoMZ4wyfgwBkIQ%3D&reserved=0>
>> ---
>> You received this message because you are
>> subscribed to the Google Groups "Pick and
>> MultiValue Databases" group.
>> To unsubscribe from this group and stop receiving
>> emails from it, send an email to
>> mvdbms+un...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mvdbms/CAHSdQ0KXs15XABXuQwnXPR1FY%2Bu%2BHFPfvDii5en5ktUpx_a0Bw%40mail.gmail.com
>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fmvdbms%2FCAHSdQ0KXs15XABXuQwnXPR1FY%252Bu%252BHFPfvDii5en5ktUpx_a0Bw%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7C%7C71c66adf352b4a08842608d9d472b1c9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637774411349537656%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2F4VUqgrEN%2FBlt7vufEK6IXE3dg0JgR6bbOBNLpEXSa0%3D&reserved=0>.
>>
>> --
>> You received this message because you are subscribed to
>> the "Pick and MultiValue Databases" group.
>> To post, email to: mvd...@googlegroups.com
>> To unsubscribe, email to: mvdbms+un...@googlegroups.com
>> For more options, visit
>> http://groups.google.com/group/mvdbms
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fmvdbms&data=04%7C01%7C%7C71c66adf352b4a08842608d9d472b1c9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637774411349693835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=hL%2FZOXeUnuGfRvq1ZcDmzEGMlJJ2mLH9Nu6iG8hZwZc%3D&reserved=0>
>> ---
>> You received this message because you are subscribed
>> to the Google Groups "Pick and MultiValue Databases"
>> group.
>> To unsubscribe from this group and stop receiving
>> emails from it, send an email to
>> mvdbms+un...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mvdbms/CAJDLGm7Q_U1Wj-rVkg3nHp-bODWqj6ab1UUq2kHJCm-XtVNctQ%40mail.gmail.com
>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fmvdbms%2FCAJDLGm7Q_U1Wj-rVkg3nHp-bODWqj6ab1UUq2kHJCm-XtVNctQ%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7C%7C71c66adf352b4a08842608d9d472b1c9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637774411349693835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=DCCR8Eshw%2BUuaaYmjjfvtiTxxrmQu9sUKooGP%2FrdwaM%3D&reserved=0>.
>>
>> --
>> You received this message because you are subscribed to
>> the "Pick and MultiValue Databases" group.
>> To post, email to: mvd...@googlegroups.com
>> To unsubscribe, email to: mvdbms+un...@googlegroups.com
>> For more options, visit http://groups.google.com/group/mvdbms
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fmvdbms&data=04%7C01%7C%7C71c66adf352b4a08842608d9d472b1c9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637774411349850053%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=8d4OouHM%2BjjS%2BFKZl6SeBhI5vvB%2BnExi3PYZSo7tfvc%3D&reserved=0>
>> ---
>> You received this message because you are subscribed to the
>> Google Groups "Pick and MultiValue Databases" group.
>> To unsubscribe from this group and stop receiving emails from
>> it, send an email to mvdbms+un...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mvdbms/463d947c-9721-47c6-9b37-ef860e3ed005n%40googlegroups.com
>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fmvdbms%2F463d947c-9721-47c6-9b37-ef860e3ed005n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7C%7C71c66adf352b4a08842608d9d472b1c9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637774411350006238%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=LxlQzBedu8Xd1O8wZPhCUkdV3EFsVjhr3KN5PqK6wdc%3D&reserved=0>.
>
> --
> You received this message because you are subscribed to
> the "Pick and MultiValue Databases" group.
> To post, email to: mvd...@googlegroups.com
> To unsubscribe, email to: mvdbms+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> <http://groups.google.com/group/mvdbms>
> ---
> You received this message because you are subscribed to the Google
> Groups "Pick and MultiValue Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mvdbms+un...@googlegroups.com
> <mailto:mvdbms+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mvdbms/35d28e93-888e-47a3-89b4-d315fde45ecdn%40googlegroups.com
> <https://groups.google.com/d/msgid/mvdbms/35d28e93-888e-47a3-89b4-d315fde45ecdn%40googlegroups.com?utm_medium=email&utm_source=footer>.

geneb

unread,
Jan 10, 2022, 3:48:13 PM1/10/22
to Pick and MultiValue Databases
On Mon, 10 Jan 2022, chandru murthi wrote:

> Personally, if I saw 'IF "END" = DESC THEN', I'd call for remedial training
> for that programmer. ;) .
>
That's actually a thing in C though. :)

Wol

unread,
Jan 10, 2022, 3:53:58 PM1/10/22
to mvd...@googlegroups.com
On 10/01/2022 20:48, geneb wrote:
> On Mon, 10 Jan 2022, chandru  murthi wrote:
>
>> Personally, if I saw 'IF "END" = DESC THEN', I'd call for remedial
>> training
>> for that programmer. ;) .
>>
> That's actually a thing in C though. :)
>

Because ' if (desc = "end") {} ' in C almost certainly does NOT do what
you intended - it will assign a "pointer to string" to desc, and return
"true". It will NOT test whether the pre-existing contents of desc were
"end" or not.

' if ("end" = desc) {} ' on the other hand will cause a compiler error.
You almost certainly intended to type ' == '

Cheers,
Wol
Message has been deleted

Tony Gravagno

unread,
Jan 10, 2022, 10:14:32 PM1/10/22
to Pick and MultiValue Databases
Not just a C thing it is. Yoda notation, a coding standard you will find.
T

George Gallen

unread,
Jan 11, 2022, 10:00:42 AM1/11/22
to mvd...@googlegroups.com
as for GOTOs........it's a trap!


From: mvd...@googlegroups.com <mvd...@googlegroups.com> on behalf of Tony Gravagno <bacj8...@snkmail.com>
Sent: Monday, January 10, 2022 10:14 PM
To: Pick and MultiValue Databases <mvd...@googlegroups.com>

Subject: Re: [mvdbms] Re: Probably a dumb question

Kevin Powick

unread,
Jan 11, 2022, 2:24:35 PM1/11/22
to Pick and MultiValue Databases
On Monday, 10 January 2022 at 13:30:06 UTC-5 Wol wrote:
 
Rather than DESC[1,1] (assuming that the input is supposed to be just a
question mark) I'd use TRIM(DESC). You're assuming they may accidentally
have typed garbage after the question mark, TRIM will remove anything
either side rather than just checking the first character.

Slight clarification. The TRIM() function, as written in your example, only removes leading and trailing spaces, not "anything either side".
--
Kevin Powick

George Gallen

unread,
Jan 12, 2022, 9:48:34 AM1/12/22
to mvd...@googlegroups.com
Universe TRIM() when specified can be non spaces.

| SYNTAX                                                                      
|                                                                             
|       TRIM (expression [,character [,option]] )                             
|                                                                             
| DESCRIPTION                                                                 
|                                                                             
|    Use  the  TRIM  function  to  remove  unwanted  characters  in           
|    expression.   If   only   expression  is  specified,  multiple           
|    occurrences of spaces and tabs are reduced to a single tab  or           
|    space,  and  all  leading  and  trailing  spaces  and tabs are           
|    removed.                                                                 
|            


From: mvd...@googlegroups.com <mvd...@googlegroups.com> on behalf of Kevin Powick <kpo...@gmail.com>
Sent: Tuesday, January 11, 2022 2:24 PM

To: Pick and MultiValue Databases <mvd...@googlegroups.com>
Subject: Re: [mvdbms] Re: Probably a dumb question
--

Reply all
Reply to author
Forward
0 new messages