PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6 ... 10
 31 
 on: April 07, 2021, 04:21:21 PM 
Started by Petrus Vorster - Last post by Petrus Vorster
Thanks Paul.

It turns out after studying your documents all i had to do was:
Write a date string YYYY-MM-DD
Then use the icell.format(yyyy/MM/dd)

You are indeed a genius.

Regards,

Peter

 32 
 on: April 07, 2021, 03:55:56 PM 
Started by Bumblebee - Last post by Bumblebee
WStr() function will not convert strings read with Line Input#
It does work with literal strings.
Code: [Select]
#include "Afx\CWStr.inc"
dim a as string
dim b as CWSTR
a = "Élégance"
b = "Élégance2"
print a
print b
print wstr(a)
b = wstr(a)
print b
print "- read utf8 file -"
a=""
open "test.txt" for input as #1
line input #1,a
print a
b = a
?b
?wstr(a)
?wstr(b)
close
sleep
end

 33 
 on: April 07, 2021, 02:28:02 PM 
Started by Bumblebee - Last post by José Roca
If the file is utf-8, you have to read it using ansi strings and then convert it to ansi or unicode, since a listbox (or any other Windows control) doesn't understand utf-8.

 34 
 on: April 07, 2021, 02:15:20 PM 
Started by Bumblebee - Last post by Bumblebee
I'm having an issue reading accented characters, as per the example.
According to Notepad, the file I'm parsing is in UTF-8 Unix (LF)

When I change variable type to CWSTR, an error occurs with the Line Input# statement.
It wants a string variable.

 35 
 on: April 07, 2021, 02:08:21 PM 
Started by Bumblebee - Last post by José Roca
What do you understand by unicode characters? Accented characters like á, é, í, ó, ú aren't unicode.

FB ansi variables can't hold unicode characters like Серге́й Серге́евич Проко́фьев.

 36 
 on: April 07, 2021, 01:53:33 PM 
Started by Petrus Vorster - Last post by Petrus Vorster
Thank you for digging up the old Files Paul

If i use those lines, the XLSWRITEDATE gives an Error 516. Deftype, Type ID ....

This is how i currently write to those excel fields:

iCell = ws.AddCell( y&,colz&+1, Val(mydata)) ' For Values
iCell = ws.AddCell( y&,colz&+1, mydata)        ' For text

the Y&, and colz& are cell coordinates.
This is from some of your examples.
If i just change the date to YYYYMMDD it still assumes it's text.

Thanks you for spending time on old stuff for me.

Kind regards.

Peter

 37 
 on: April 07, 2021, 01:07:50 PM 
Started by Bumblebee - Last post by Bumblebee
I use regular string variables to write the file that contains unicode characters. It seems to work with no issues.
Nor did I specify utf-x encoding when writing the file.

Replacing string with cwstr causes an invalid data type in the input statement.

 38 
 on: April 07, 2021, 12:29:40 PM 
Started by Bumblebee - Last post by Paul Squires
CWSTR will work. WSTRING will work as well.
I doubt that STRING will work reliably.

 39 
 on: April 07, 2021, 12:19:13 PM 
Started by Bumblebee - Last post by Bumblebee
Might be a problem with the string variables I'm using.
Do I need to use CWSTR to preserve unicode characters?

 40 
 on: April 07, 2021, 12:07:55 PM 
Started by Bumblebee - Last post by Paul Squires
Hi, yes the Listbox code does support unicode. The following correctly displays your code:

Code: [Select]
   for i as long = 0 to 5
      frmMain.List1.Items.Add( "Élégance" & i )
   next

Pages: 1 2 3 [4] 5 6 ... 10