Search found 117 matches

by newbieforever
Jul 06, 2018 23:08
Forum: Beginners
Topic: Another program icon via command line
Replies: 66
Views: 5575

Another program icon via command line

And now for something completely different: I know that the icon of a FB-compiled program can be set by including a rc file when compiling the code (with FB_PROGRAM_ICON ICON "MyIcon.ico"). How a FB program (MyProgram.exe) could be enabled (by its code) to change its icon via command line:...
by newbieforever
Jul 05, 2018 15:27
Forum: Beginners
Topic: Using shell
Replies: 13
Views: 2353

Re: Using shell

@Josep Roca: YES, THIS WORKS, HALLELUJAH!
by newbieforever
Jul 05, 2018 14:02
Forum: Beginners
Topic: Using shell
Replies: 13
Views: 2353

Re: Using shell

Just a footnote:
@dodicat: I think the line shell " tmp2.bat" must fail because your tmp2.bat is a unicode file; bat must be ansi...
by newbieforever
Jul 05, 2018 11:35
Forum: Beginners
Topic: Using shell
Replies: 13
Views: 2353

Re: Using shell

A simplified testing code: ' DOS batch command works: ' echo Hello > "Сергeй.txt" ' The file is created. dim as wstring * 4 DQ = wchr(34) shell "echo Hello > " & DQ & "Сергeй.txt" & DQ Print "echo Hello > " & DQ & "Сергeй.txt" &am...
by newbieforever
Jul 05, 2018 8:32
Forum: Beginners
Topic: Using shell
Replies: 13
Views: 2353

Using shell

Another newbie question: A DOS batch command like this works perfectly: echo Hello > "Сергeй Сергeевич.txt" Is it impossible to do the same via shell? * dim as wstring * 100 fi = """Сергeй Сергeевич.txt""" 'dim as wstring * 100 fi = """Hans Pete...
by newbieforever
Jul 04, 2018 12:13
Forum: Beginners
Topic: Functions...another newbie question
Replies: 6
Views: 902

Re: Functions...another newbie question

Yes, fails means no usable aux returned; no crash and no error message. OK, the reason must be associated to the assembly code hack, although I don't understand why aux can not be returned... But the use of a function was just an attempt, I don't need it really. (I assumed this was a basic newbie is...
by newbieforever
Jul 04, 2018 10:20
Forum: Beginners
Topic: Functions...another newbie question
Replies: 6
Views: 902

Re: Functions...another newbie question

PS: aux to be returned is Wstring. Is this the problem?
by newbieforever
Jul 04, 2018 9:48
Forum: Beginners
Topic: Functions...another newbie question
Replies: 6
Views: 902

Functions...another newbie question

Another newbie question: Declare Function Ustr2Wstr(sss As String) As String Function Ustr2Wstr(sss As String) As String sss = sss & chr(0) & chr(0) Dim As Wstring * 500 aux = "" asm pushad asm mov esi, [sss] asm lea edi, [aux] asm mov ecx, 500 asm rep movsb asm popad Return aux En...
by newbieforever
Jul 04, 2018 9:43
Forum: Beginners
Topic: Open a file with a unicode-encoded name
Replies: 51
Views: 4189

Re: Open a file with a unicode-encoded name

(jj2007:) ...this thread is to help OP newbieforever... You are great, jj2007! Maybe Roca's mighty library will be a revelation even for me (yes, please, "a new thread, maybe titled "Using Unicode file I/O in FreeBasic"), but I admire the charm of your asm solution; probably no libra...
by newbieforever
Jul 04, 2018 7:36
Forum: Beginners
Topic: Error 17 from Return in subs or functions
Replies: 3
Views: 567

Re: Error 17 from Return in subs or functions

OK, thank you, nimdays!

I was confused because I saw everywhere that Return can be used in Subs too. But i see now:
"Sub is the same as Function, except it does not allow a value to be returned."
by newbieforever
Jul 04, 2018 6:33
Forum: Beginners
Topic: Error 17 from Return in subs or functions
Replies: 3
Views: 567

Error 17 from Return in subs or functions

Declare Sub RemNul(sss As String) Sub RemNul(sss As String) Dim As String aux = "" For in As Integer = 1 to len(sss) Dim As String fd = mid(sss, in, 1) If fd <> chr(0) Then aux = aux & fd Next Return aux End Sub What am I doing wrong? Return aux: >>> error 17: Syntax error, found 'aux...
by newbieforever
Jul 03, 2018 13:05
Forum: Beginners
Topic: Open a file with a unicode-encoded name
Replies: 51
Views: 4189

Re: Open a file with a unicode-encoded name

jj2007:

Fantastico!!! How did you come up with the idea that it could work with chr+chr???
by newbieforever
Jul 03, 2018 10:39
Forum: Beginners
Topic: Open a file with a unicode-encoded name
Replies: 51
Views: 4189

Re: Open a file with a unicode-encoded name

jj2007, that's incredible, overwhelming! If I correctly understand your method, you are able to convert the file name string extracted from the file into a wstring (by appending chr(0)+chr(0) to it and aplying some asm commands). Anyway, this is ingenious!!! At the moment I don't understand all det...
by newbieforever
Jul 03, 2018 6:34
Forum: Beginners
Topic: Open a file with a unicode-encoded name
Replies: 51
Views: 4189

Re: Open a file with a unicode-encoded name

I do not know if I'm still totally confused or already completely despaired...

It seems that all FB experts here see no way to read a file name from a unicode-encoded text file and then create a file of that name.

Is FB really unable to handle such a simple task??? Can this be true???

Go to advanced search