Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 8 Jahren, 5 Monaten
Letzter Beitrag:
vor 8 Jahren, 5 Monaten
Beteiligte Autoren:
DanM, Dan M, Ruben Sanchez Peña, Piet van Zanten, Hairy Haggis.pcs.crosspost, Merijn

How do you concatenate a string which include " " ?

Startbeitrag von DanM am 12.07.2009 15:01

I am trying to create a string which will end up as ...

gResStart is a string = HTTPRequest("http://www.galco.com/scripts/cgiip.exe/wa/wcat/catalog.htm?searchbox=FZ1600";)

I am passing in 2 parameters to the procedure:

1. HTTP string (http://www.galco.com/scripts/cgiip.exe/wa/wcat/catalog.htm?searchbox=)
2. the part number (FZ1600)

BUT ... they need to be enclosed by the quotes " " ...

I have tried single quotes around the double quotes but everything I have tried ends up as an error or what is between the set of quotes is taken literally, not as the value of the variables??

Here is what I have tried ... (at least the one I thought made the most sense)
--------------------------------------------------------------------------------
webaddress is a string = (StockCheckString + PartNumber)
gResStart is a string = HTTPRequest(" + webaddress + ")
--------------------------------------------------------------------------------

help ... please ...

Antworten:

Dan,

To insert a double qoute into a string use Charact(34).

HTH
Merijn

von Merijn - am 12.07.2009 18:48

I tried this ...

sStockCheckURL is a string = "http://www.galco.com/scripts/cgiip.exe/wa/wcat/catalog.htm?searchbox=";
sPartToFind is a string = "FZ1600"
gResStart = HTTPRequest(Charact(34) + sStockCheckURL + sPartToFind + Charact(34))

... and I get no results back.

Can you provide more of an explanation or even an example.

thanks ... Dan

von Dan M - am 12.07.2009 19:07

Re: How do you concatenate a string which include " " ?

Hi there,

Have you tried using ""string to enter""

ie MyParam is string = "Hairy"
MyStr = "hello """ + MyParam + """"

should be 'hello "Hairy"'

I havenot tested this just typed it in, but it should work...




DanM wrote in news message :
>
>
> I am trying to create a string which will end up as ...
> gResStart is a string = HTTPRequest("http://www.galco.com/scripts/cgiip.exe/wa/wcat/catalog.htm?searchbox=FZ1600";)
> I am passing in 2 parameters to the procedure:
> 1. HTTP string (http://www.galco.com/scripts/cgiip.exe/wa/wcat/catalog.htm?searchbox=)
> 2. the part number (FZ1600)
> BUT ... they need to be enclosed by the quotes " " ...
> I have tried single quotes around the double quotes but everything I have tried ends up as an error or what is between the set of quotes is taken literally, not as the value of the variables??
> Here is what I have tried ... (at least the one I thought made the most sense)
> --------------------------------------------------------------------------------
> webaddress is a string = (StockCheckString + PartNumber)
> gResStart is a string = HTTPRequest(" + webaddress + ")
> --------------------------------------------------------------------------------
> help ... please ...
>

Message forwarded from pcsoft.us.windev

von Hairy Haggis.pcs.crosspost - am 13.07.2009 07:30
Hi Dan,

Try not using quotes. It is not necessary.

Regards,
Piet

von Piet van Zanten - am 13.07.2009 07:46
Piet,

I believe this is an example where the Quotes are necessary ...

what do I do now ... ?

sPriceBreakQty = ExtractString(ExtractString(sAPriceBreakLine, 1, "[/td]"),2,"[td width="50%" align="center class"="regprice"]")

I need to enclose the

[td width="50%" align="center class"="regprice"]

in quotes to define the extraction string BUT there are quotes in the HTML surrounding 3 of the pieces of data??

How do I deal with this situation?

Dan

von DanM - am 13.07.2009 15:45
Hi. Replace the " char with a pair ""

sPriceBreakQty = ExtractString(ExtractString(sAPriceBreakLine, 1, "[/td]"),2,"[td width=""50%"" align=""center"" class=""regprice""]")

von Ruben Sanchez Peña - am 13.07.2009 18:15

That did the trick !!! ... Thank you Ruben

von Dan M - am 14.07.2009 00:27
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.