Page 1 of 1

Posted: Sun Jul 14, 2002 4:54 am
by BackupUser
Restored from previous forum. Originally posted by Fangbeast.

I'm having trouble putting a HTML page (which I need to do) as each line stored in a DATA statement.

I replace the literal quote marks with CHR(34) but am still getting a syntax error. Am I missing something??

Original line


" style="font-family: MS Sans Serif; font-size: 8pt; margin-top: 0; margin-bottom: 0">


Replacement


""+chr(34)+" style="+chr(34)+"font-family: MS Sans Serif; font-size: 8pt; margin-top: 0; margin-bottom: 0"+chr(34)+">"

Anyone have an idea what I am doing wrong??

You be quiet _Paul_ !!! (GRIN)

Fangles

Posted: Sun Jul 14, 2002 5:04 am
by BackupUser
Restored from previous forum. Originally posted by Paul.

OK Fangs... I'll be quite and not tell you that HTML can use ' instead of "


so your line could be:
' style='font-family: MS Sans Serif; font-size: 8pt; margin-top: 0; margin-bottom: 0'>


But of course I'm being quite and not telling you this. :)

Posted: Sun Jul 14, 2002 5:30 am
by BackupUser
Restored from previous forum. Originally posted by Fangbeast.
OK Fangs... I'll be quite and not tell you that HTML can use ' instead of "

so your line could be:
' style='font-family: MS Sans Serif; font-size: 8pt; margin-top: 0; margin-bottom: 0'>

But of course I'm being quite and not telling you this. :)
Gee, i'm so glad you are bing quiet and not lurking and behaving yourself as I know that' quite unlike you (very evil grin)

And besides, I have alreay worked out the problem and am fixing a JavaScript error that I inadvertently made but thanks anyway or person who know everything :):):)

Fangles

Posted: Sun Jul 14, 2002 5:46 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Hmm...

this code:

Code: Select all

OpenFile(1,"c:\stringoutput.txt")
A$ = ""+Chr(34)+" style="+Chr(34)+"font-family: MS Sans Serif; font-size: 8pt; margin-top: 0; margin-bottom: 0"+Chr(34)+">"
WriteStringN("DataSection")
WriteStringN("Label:")
WriteString("Data.b ")
For a = 0 To Len(A$)
    WriteString("$"+Hex(PeekB(@A$+a)))
    WriteString(",")
Next a
WriteStringN("0")
WriteStringN("")
WriteStringN("EndDataSection")
CloseFile(1)
generates this file (c:\stringoutput.txt):

Code: Select all

DataSection
Label:
Data.b $3C,$62,$6F,$64,$79,$20,$62,$67,$63,$6F,$6C,$6F,$72,$3D,$22,$3C,$48,$49,$56,$5F,$63,$6F,$6C,$6F,$75,$72,$3E,$22,$20,$73,$74,$79,$6C,$65,$3D,$22,$66,$6F,$6E,$74,$2D,$66,$61,$6D,$69,$6C,$79,$3A,$20,$4D,$53,$20,$53,$61,$6E,$73,$20,$53,$65,$72,$69,$66,$3B,$20,$66,$6F,$6E,$74,$2D,$73,$69,$7A,$65,$3A,$20,$38,$70,$74,$3B,$20,$6D,$61,$72,$67,$69,$6E,$2D,$74,$6F,$70,$3A,$20,$30,$3B,$20,$6D,$61,$72,$67,$69,$6E,$2D,$62,$6F,$74,$74,$6F,$6D,$3A,$20,$30,$22,$3E,$0,0

EndDataSection
You can include this file in your sourcecode.
Little Test:

Code: Select all

OpenConsole()
PrintN(PeekS(?Label))
Delay(3000)
End


DataSection
Label:
Data.b $3C,$62,$6F,$64,$79,$20,$62,$67,$63,$6F,$6C,$6F,$72,$3D,$22,$3C,$48,$49,$56,$5F,$63,$6F,$6C,$6F,$75,$72,$3E,$22,$20,$73,$74,$79,$6C,$65,$3D,$22,$66,$6F,$6E,$74,$2D,$66,$61,$6D,$69,$6C,$79,$3A,$20,$4D,$53,$20,$53,$61,$6E,$73,$20,$53,$65,$72,$69,$66,$3B,$20,$66,$6F,$6E,$74,$2D,$73,$69,$7A,$65,$3A,$20,$38,$70,$74,$3B,$20,$6D,$61,$72,$67,$69,$6E,$2D,$74,$6F,$70,$3A,$20,$30,$3B,$20,$6D,$61,$72,$67,$69,$6E,$2D,$62,$6F,$74,$74,$6F,$6D,$3A,$20,$30,$22,$3E,$0,0
EndDataSection
But i´m too late anyway...

cya,
...Danilo

(registered PureBasic user)

Posted: Tue Jul 16, 2002 5:13 am
by BackupUser
Restored from previous forum. Originally posted by TronDoc.

Hey Danilo:
Better late than not at all! That still is an interesting piece of code. I'm sure I will have a use for it in the future. --Joe

elecTRONics DOCtor
{registeredPB}P150 32Mb w98/DOS/Linux NO DirX NO IE :wink:

Posted: Tue Jul 16, 2002 9:23 am
by BackupUser
Restored from previous forum. Originally posted by fred.

Why not using IncludeBinary ?

Fred - AlphaSND

Posted: Tue Jul 16, 2002 5:07 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.

> Why not using IncludeBinary ?

Too easy.

cya,
...Danilo

(registered PureBasic user)

Posted: Tue Jul 16, 2002 8:43 pm
by BackupUser
Restored from previous forum. Originally posted by fred.



Fred - AlphaSND