I am new to ASNA Visual RPG. I spent hours in searching how to print a string in ASNA Visual RPG 9.x. But no luck on finding how to print a simple "hello world" String.
Can someone show me how to print "hello world" in the console?
Example in VB (hope that you could translate it to ASNA Visual RPG)
Sub Main ()
Dim text As String
text = "Hello World"
Console.WriteLine(text)
Console.Read()
End Sub
Thanks
Sorry for all the trouble guys.. I just found out the answer. I am using Visual Studio 2008 for ASNA Visual RPG. To print "Hello World", all we need to do is to type:
System.Console.WriteLine("Hello World")
Related
I have a Localizable.strings (base) file with, for example, the following strings:
"hello_world" = "Hello World";
"hello_world2" = "Hello World";
It is being translated to multiple languages. So I also have the following:
Localizable.strings (Chinese (Simplified))
Localizable.strings (Russian)
and etc.
Now the problem is that as the project grows, we have more and more new strings being added. But we don't want to wait for the translators to fully translate all the strings before we ship the app. Therefore, we end of having this Localizable.strings (Chinese (Simplified)) where hello_world2 is missing:
"hello_world" = "你好世界";
By default, the not translated string will be shown as the key "hello_world2" in the app. The question: is there a way to say, if a translation of key "hello_world2" doesn't exist, use the base translation instead?
Additional Info:
I know that for storyboard file, if it is partially translated, then it will just use the base translation for not translated strings. However, the same (nice) behaviour doesn't happen for other general .strings file. Really looking for a elegant way to solve this issue.
I find the easiest way to cope with this is to use the default string as the key. So you might have:
Base:
"Hello World" = "Hello World";
"Hello World 2" = "Hello World 2";
Chinese:
"Hello World" = "Hello World in Chinese";
If you haven't made any translations you just need to have at least one placeholder string in the file to avoid a compilation error, e.g. for a double space:
Russian:
/* Placeholder */
" " = " ";
It also makes the translator's job much easier!
We have some ancient vb6 program that creates barcode using printer objects that relies on window fonts, which works fine with code39.
Recently we need to switch the font to code128, after some work we converted the input into code128 format string, and trying print using the same method, however, the printout does not seem right (strange thing is, when we copy the converted string into excel and use the same code 128 font to print it out, it display and print out prefectly)
I was wondering if anyone had the same experience, if so, can anyone shred some lights please?
The following are the code we used to print out barcode
dim sOrg as string
sOrg = "12345888"
printer.fontName = "code39"
printer.print sOrg 'This prints it out perfectly
'However when we change font to code
'this returns Í,BZx}Î which can be copy onto Excel and print out properly
sOrg = convertTo128(sOrg)
printer.fontName = "Code 128"
printer.print sOrg 'print out with part barcode line, part squares
You may use following project which includes VB6 project and open Barcode Font
barcode fonts and encoders
I am using Run Script in Xcode, I am facing some problem
I am declaring variable like below
URL1 = "/Users/UserName/Desktop/Folder/13072012/libRestKit.a"
And below i am printing it echo "Test $URL1 Test" I tried like this also "Test ${URL1} Test"
I am not able to print the URL1 value, below i use this
echo "Hello, world!"
and i am able to print this, I am new to scripting What is the problem can any one help me out
Try without spaces:
URL1="/Users/UserName/Desktop/Folder/13072012/libRestKit.a"
Putting spaces around = is a common error when using bash and other shells of the same family.
I'm trying to write some Office automation code and I cannot get IntelliSense help for the PIA Office types. The strange thing is that it works fine in C# and also in the Tutorial.vs2010 F# Solution with some of the same code.
I'm using VS10 and PIA for Office 14.
VS
Any ideas?
I forgot to include a reference to Office.dll. That appeared to fix the issue.
For anyone finding this later, but can't figure out where office.dll is, like I did. I faced the same Issue with F# 4.0, Office 2013, and VS Community 2015 Update 2.0
I typed this in the beginning of the file to get Intellisense working, no need to search for office.dll in your machine:
#r "office, Version = 15.0.0.0"
This is the same text it gives you with <Note>, but without the Culture=neutral and PublicKey=w/e. Seems to work flawlessly.
For context, this is how my file starts:
#r "Microsoft.Office.Interop.Excel"
#r "office, Version = 15.0.0.0"
open System
open System.IO
open System.Reflection
open Microsoft.Office.Interop.Excel
let app = ApplicationClass(Visible = true)
let sheet = app.Workbooks
.Add()
.Worksheets.[1] :?> _Worksheet
Edit: whats the difference between reading a backslash from a file and writing it to the interactive window vs writing directly the string to the interactive window ?
For example
let toto = "Adelaide Gu\u00e9nard"
toto;;
the interactive window prints "Adelaide Guénard".
Now if I save a txt file with the single line Adelaide Gu\u00e9nard . And read it in:
System.IO.File.ReadAllLines(#"test.txt")
The interactive window prints [|"Adelaide Gu\u00e9nard"|]
What is the difference between these 2 statements in terms of the interactive window printing ?
As far as I know, there is no library that would decode the F#/C# escaping of string for you, so you'll have to implement that functionality yourself. There was a similar question on how to do that in C# with a solution using regular expressions.
You can rewrite that to F# like this:
open System
open System.Globalization
open System.Text.RegularExpressions
let regex = new Regex (#"\\[uU]([0-9A-F]{4})", RegexOptions.IgnoreCase)
let line = "Adelaide Gu\\u00e9nard"
let line = regex.Replace(line, fun (m:Match) ->
(char (Int32.Parse(m.Groups.[1].Value, NumberStyles.HexNumber))).ToString())
(If you write "some\\u00e9etc" then you're creating string that contains the same thing as what you'd read from the text file - if you use single backslash, then the F# compiler interprets the escaping)
It uses the StructuredFormat stuff from the F# PowerPack. For your string, it's effectively doing printfn toto;;.
You can achieve the same behaviour in a text file as follows:
open System.IO;;
File.WriteAllText("toto.txt", toto);;
The default encoding used by File.WriteAllText is UTF-8. You should be able to open toto.txt in Notepad or Visual Studio and see the é correctly.
Edit: If wanted to write the content of test.txt to another file in the clean F# interactive print, how would i proceed ?
It looks like fsi is being too clever when printing the contents of test.txt. It's formatting it as a valid F# expression, complete with quotes, [| |] brackets, and a Unicode character escape. The string returned by File.ReadAllLines doesn't contain any of these things; it just contains the words Adelaide Guénard.
You should be able to take the array returned by File.ReadAllLines and pass it to File.WriteAllLines, without the contents being mangled.