NexusFi: Find Your Edge


Home Menu

 





PowerLanguage & EasyLanguage. How to get the platform name with code?


Discussion in EasyLanguage Programming

Updated
    1. trending_up 95 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread

PowerLanguage & EasyLanguage. How to get the platform name with code?

  #1 (permalink)
futurenow
Earth planet
 
Posts: 53 since Feb 2017
Thanks Given: 42
Thanks Received: 13

Hello

How would it be possible to get the platform name or any kind of distinctive name reference with PowerLanguage and EasyLanguage? to in that way run some different syntax depending on the platform is running, because PowerLanguage and EasyLanguage syntax are not always exactly the same.

I've seen you can get the app id with aiApplicationType but it would not be the solution for this situation.

Thank you

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

futurenow,

I am not aware of such a reserved word. For simplicity and for maximizing the capabilities of the languages it might make sense to simply keep the codes separated.

Regards,

ABCTG


futurenow View Post
Hello

How would it be possible to get the platform name or any kind of distinctive name reference with PowerLanguage and EasyLanguage? to in that way run some different syntax depending on the platform is running, because PowerLanguage and EasyLanguage syntax are not always exactly the same.

I've seen you can get the app id with aiApplicationType but it would not be the solution for this situation.

Thank you


Follow me on Twitter Reply With Quote
  #3 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360



ABCTG View Post
futurenow,

I am not aware of such a reserved word. For simplicity and for maximizing the capabilities of the languages it might make sense to simply keep the codes separated.

Regards,

ABCTG

And you should know @futurenow that if anyone here would know this, it is @ABCTG - one of the most knowledgeable Easy Language programmer here, in my opinion.

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Thank you for the kind words @kevinkdog.

@futurenow, even if you would come up with a way to identify the platform (which you probably could do by finding one reserved word that only exists in one platform and for which you would have to create a function in the other platform, so you could distinguish by the return values) the obstacle that you will not be able to overcome is the compiler in the platforms. If your code contains reserved words that the compiler does not recognize it will throw an error and you will not be able to compile your code. This is what would happen in both platforms, if you have code that is exclusive to the other platform only.

Regards,

ABCTG


kevinkdog View Post
And you should know @futurenow that if anyone here would know this, it is @ABCTG - one of the most knowledgeable Easy Language programmer here, in my opinion.


Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
futurenow
Earth planet
 
Posts: 53 since Feb 2017
Thanks Given: 42
Thanks Received: 13


ABCTG View Post
Thank you for the kind words @kevinkdog.

@futurenow, even if you would come up with a way to identify the platform (which you probably could do by finding one reserved word that only exists in one platform and for which you would have to create a function in the other platform, so you could distinguish by the return values) the obstacle that you will not be able to overcome is the compiler in the platforms. If your code contains reserved words that the compiler does not recognize it will throw an error and you will not be able to compile your code. This is what would happen in both platforms, if you have code that is exclusive to the other platform only.

Regards,

ABCTG


Thank you for your answers @ABCTG and @kevinkdog

Yes, I understand the point about "For simplicity and for maximizing the capabilities of the languages" and about "If your code contains reserved words that the compiler does not recognize it will throw an error and you will not be able to compile your code".

However, even with that, the part about to know what is the platform or any other way to for example identify the language name or anything like that, could be useful in a couple scenarios.

If someone want to share any idea about this, it will be welcome.

Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

futurenow,

I provided you with an idea for an approach on how to do the identification in my previous post. However, it will require a bit of innovation on your part.

Regards,

ABCTG


futurenow View Post
Thank you for your answers @ABCTG and @kevinkdog

Yes, I understand the point about "For simplicity and for maximizing the capabilities of the languages" and about "If your code contains reserved words that the compiler does not recognize it will throw an error and you will not be able to compile your code".

However, even with that, the part about to know what is the platform or any other way to for example identify the language name or anything like that, could be useful in a couple scenarios.

If someone want to share any idea about this, it will be welcome.


Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360


futurenow View Post
Thank you for your answers @ABCTG and @kevinkdog

Yes, I understand the point about "For simplicity and for maximizing the capabilities of the languages" and about "If your code contains reserved words that the compiler does not recognize it will throw an error and you will not be able to compile your code".

However, even with that, the part about to know what is the platform or any other way to for example identify the language name or anything like that, could be useful in a couple scenarios.

If someone want to share any idea about this, it will be welcome.

Why not just have an input variable:

input:PlatformType("Tradestation");

If PlatformType="Tradestation" then begin
//special code run only in TS
end;


Probably do simplistic for you, but then again I have no idea why this would be needed. If I have code in Tradestation, I know I am running in Tradestation. And if the code is in MultiCharts, I generally know that too. Maybe you are doing something way out of my league though...

Follow me on Twitter Reply With Quote
Thanked by:
  #8 (permalink)
futurenow
Earth planet
 
Posts: 53 since Feb 2017
Thanks Given: 42
Thanks Received: 13


ABCTG View Post
futurenow,

I provided you with an idea for an approach on how to do the identification in my previous post. However, it will require a bit of innovation on your part.

Regards,

ABCTG


ABCTG,

I think you refer to the part of "which you probably could do by finding one reserved word that only exists in one platform and for which you would have to create a function in the other platform, so you could distinguish by the return values".

Yes, that idea would be a way, thank you. What I meant in the last post was about that if maybe could be another more direct and automatic way, then it will be welcome, just if someone has had a similar situation and has found any more direct solution.

Reply With Quote
  #9 (permalink)
futurenow
Earth planet
 
Posts: 53 since Feb 2017
Thanks Given: 42
Thanks Received: 13


kevinkdog View Post
Why not just have an input variable:

input:PlatformType("Tradestation");

If PlatformType="Tradestation" then begin
//special code run only in TS
end;


Probably do simplistic for you, but then again I have no idea why this would be needed. If I have code in Tradestation, I know I am running in Tradestation. And if the code is in MultiCharts, I generally know that too. Maybe you are doing something way out of my league though...

kevinkdog,

This is just for some simple situations like for example if the code will print text, then do it with a specific text format, etc. depending on the platform is running, so not anything too fancy.

Yes, of course the person knows if the code is running in MC or TS, but in this case the point is that the code itself can get this reference automatically in a way the person doesn't need to specify it.

By the way, the solution you show just specifying it with an input works as should, thank you for posting the idea, but this requires you remember to type the platform name or language name in the input which I perfectly understand is a valid situation, but the main question in this thread is about any simple way that can do something equivalent automatically, for example like a way to know the language name:
`if GetLanguageName = "PowerLanguage" then {run logic A} else {run logic B};`

Reply With Quote




Last Updated on April 23, 2024


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts