How do I do the same in #Sharp can someone please tell me how to code this

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
rn@warner-it.com
Posts: 46
Joined: Mon Mar 04, 2019 4:41 pm

How do I do the same in #Sharp can someone please tell me how to code this

Post by rn@warner-it.com »

Hi DTos, SubStr worked in Vulcan but not I XSharp can some please advise as to how I can covert this to what I did before also the following: Date := DDMMYYYY to Just Date := YYYYMM or MMYYYY


TempYear := DToS(Today())
cYear := SubStr(TempYear,1,4)
cMon := SubStr(TempYear,5,2)
cDay := SubStr(TempYear,7,2)
TempYear := cDay + "." + cMon + "." + cYear
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

How do I do the same in #Sharp can someone please tell me how to code this

Post by lumberjack »

rn@warner-it.com wrote:Hi DTos, SubStr worked in Vulcan but not I XSharp can some please advise as to how I can covert this to what I did before also the following: Date := DDMMYYYY to Just Date := YYYYMM or MMYYYY
Did you reference the XSharp.RT / Runtime?
______________________
Johan Nel
Boshof, South Africa
rn@warner-it.com
Posts: 46
Joined: Mon Mar 04, 2019 4:41 pm

How do I do the same in #Sharp can someone please tell me how to code this

Post by rn@warner-it.com »

I Just tried it with adding the x# RT no change still errors

What is the command to get the date is it datetime date does not work and DTos does not work Datetime does also nothing.
User avatar
Chris
Posts: 4922
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

How do I do the same in #Sharp can someone please tell me how to code this

Post by Chris »

Please tell us what errors you are getting.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

How do I do the same in #Sharp can someone please tell me how to code this

Post by FFF »

m,
Xide, new x#-runtime app, start.prg
FUNCTION Start( ) AS VOID
VAR TempYear := DToS(Today())
VAR cYear := SubStr(TempYear,1,4)
VAR cMon := SubStr(TempYear,5,2)
VAR cDay := SubStr(TempYear,7,2)
? TempYear := cDay + "." + cMon + "." + cYear
RETURN

Compiles and runs flawless.

@All: Guys,
if you want help it is a question of courtesy to provide readable questions.
You expect "us" to invest our free time, but are to lazy, to type some meaningful sentences? Not to mention the essentials, as What OS, what patch of X#, which tool is used...
Sorry for bluntness, but i feel it is time for this little reminder....

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
rn@warner-it.com
Posts: 46
Joined: Mon Mar 04, 2019 4:41 pm

How do I do the same in #Sharp can someone please tell me how to code this

Post by rn@warner-it.com »

Hi Karl,
I agree with your Reference from your reply I am sorry if I did not give you the specifics as you required it is definitely not laziness that I did not give you all the information. Just a question is there a reference or examples as to how to recode certain things in X#. It is a little frustrating when things that work before do not work now unless certain changes is this documented anywhere we can read or use. It is not my ambition to ask for help if I can solve the problem myself. If you want people like me or others to use X' to develop then it would be useful if we had some insight as what needs to be changed in code for things work as they did before

Regards,
Raymond
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

How do I do the same in #Sharp can someone please tell me how to code this

Post by FFF »

Hi Raymond,
no offence meant...
The first station for "learning" is probably the X# helpfile, there's a section explaining how to move from VO to X#. Also it shows, how some of the VO samples are moved. Also read the section re the VoX#-Transporter.
Yes, we could do with a complete "Transformation guide", but that requires manpower...

Re your topic: I still don't see, where you have to recode. IIRC, the only thing that VN didn't have, was the "VAR" shortcut.
So If in VO you had
Local TempYear as String or even
Local TempYear
you should be fine - if not, you'll see compiler errors, which should explain what's wrong.
If they are not clear, post here your code (ideally, as in VN-days " a reproducible sample in max 10 lines" ;) ) and the errors you get. Then we have a lot better start to be of help.

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
rn@warner-it.com
Posts: 46
Joined: Mon Mar 04, 2019 4:41 pm

How do I do the same in #Sharp can someone please tell me how to code this

Post by rn@warner-it.com »

Hi Karl,
No offence taken I have solved quite a few things myself but some things do not seem to work for example office automation like outlook things that worked before do not work under office 365.
Anyway coming back to what we were discussing here is the code as O have always used it and it does not work here in my repository.
LOCAL TempYear AS STRING
LOCAL cYear, cMon, cDay AS STRING


TempYear := DToS(Today())
cYear := SubStr(TempYear,1,4)
cMon := SubStr(TempYear,5,2)
cDay := SubStr(TempYear,7,2)
TempYear := cDay + "." + cMon + "." + cYear
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

How do I do the same in #Sharp can someone please tell me how to code this

Post by FFF »

Raymond,
that leaves me in the dark.
* "Repository"? WHERE is you code?
* Did you try as in my suggestion?
* what is "does not work"? Compiles not, crashs at runtime, TempYear does not contain 27.04.2019, or what?

That was exactly my complain earlier: Why have i to ask for this things? It is YOUR job to provide the information.
And please, don't mix problems in one thread. makes it really messy. Finally, while i'm in soap box mode, PLS provide meaningful text in the "Topic" - noone has a chance to find your problem and a possible solution later on with this.
Suggestion:
[2.0.0.1 FOX; XIDE 1.17; W8.1/64 german; .Net 4.8 ] Substring produces compiler error #123456"
Later on you might hopefully edit this to
[2.0.0.1 FOX; XIDE 1.17; W8.1/64 german; .Net 4.8 ] Substring produces compiler error #123456" // SOLVED
;)

@Robert: any chance to add the meta info in the personal data, so it get's automatically added? Would help...

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
Chris
Posts: 4922
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

How do I do the same in #Sharp can someone please tell me how to code this

Post by Chris »

Raymond, after several posts in this thread already, you still have not told us what error messages you are getting. How can we help if you are not giving any information?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply