Powerscript 2.0

I was cooking an idea how to extend the current powerscript to accomplish some long wanted features like:
-Optional arguments
-Operator overload
-Inline functions
-Interfaces
-User defined enumerations
-Class templates
-Partial classes
-Implicit casting of ATD (abstract data types, ie: objects)
-Parametrized constructors
-Linq
-Virtual classes
-Name spaces
and many more ...
Can be done without modify powerbuilder, can be used in any version of PB, doesn't require migration of existing code, and is 100% powerscript technology.
This can be accomplished using metaprograming techniques ! How?
We write our code in ps2.0 using the new extended syntax, and then use a translator to regular powerscript, the generated code is then imported on powerbuilder.
I already use some of the features mentioned, manually creating the powerscript and importing it.
It can work bidirectionally, coexisting both ps2.0 in regular ps1 projects. So visual components still be created and edited in PBIDE.
If you think about it, these features are no more than syntax sugar that can be translated to regular powerscript.
Of course the strong typing and other compiler checks are let to powerbuilder. We mark(comment adds)  the generated code lines so can trace back to our powerscript2.0 IDE the original error object/line. Orca will be used to export/import code.
Has anybody already think this? Can you see any strong reason why this can't work?
Regards,
Dinis from Portugal

No I can't say I have thought of that and can't see why not. Your concept could be a smart bridge to the huge world of java.
In 1990, before I met PowerBuilder1A, a friend told me about Object Orientation. He didn't understand it but said it was something about data and process being together. My mind ran away with that and I thought it would be brilliant if every piece of data was communicated enveloped with it's business rules and presentation. Whichever runtime platform terminal or workstation would present the user with data in forms. Never got anywhere with it, but PB, html, style sheets, XML, SQL etc soon filled that gap.
24 years later, your ps2 concept awakens my mis-interpretation of OO. In my mind an extended OO data model should be able to generate a complete pb system. Although your clever bidirectional concept of sharing between 3gl - 4gl is probably more do-able than an OO model with meta-script interface to PB (and database).

Similar Messages

  • Help needed using a PowerScript Tutorial please

    Hi
    I'm just following this tutorial PowerShell check folder for modified files in the last X minutes which crashes when I get to line 5 :-
    $xminutes="60"
    $xPath="c:\temp\*.*"
    $xfile = Get-ChildItem -Path $xPath -Filter *.txt, *.xml | ? {
    $_.LastWriteTime -gt (Get-Date).AddMinutes(-$xminutes) }
    Write-Host $xfile
    The error is :-
    Get-ChildItem : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Filter'.
    Specified method is not supported.
    At line:5 char:46
    +  $xfile = Get-ChildItem -Path $xPath -Filter *.txt, *.xml | ? {
    +                                             
    ~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
        + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.GetChildItemCommand
    I'm very new to Powerscript(v4 installed) and I get confused where the pipe and question mark appear. Can anyone help to correct this line for me please.
    Kind Regards
    Matthew

    Issue is already fixed, thats fine.
    Additional info:
    (1) With  $xminutes="60"
    you define a string, not number.  AddMinutes() requires a number (a double value).
    Powershell automatically converts your string into a number before handing it over to AddMinutes.
    It is better to write
    $xminutes=60
    (2) The  ?  is a short alias for 
    Where-Object
    . I avoid "?" and use the "longer" alias  Where 
    instead: It still is shorter than "where-object" but it is clear and easier to read.
    The same with "%":
    %=foreach=ForEach-Object
    I'm used to avoid  % , I prefer
    foreach.
    Walter

  • HELP!! Using a vba script in Outlook to copy attachments to c:\temp folders automatically

    Hi
    I'm brand new to Visual Basic really - you will be able to tell that I am a complete beginner. I wouldn't be posting here but I had tried asking other Forums but have not got any responses.
    This is the problem:- I've found a basic VB script to copy attachments within Outlook 2000 Inbox to the c:temp folder when a new email arrives in. When I debug the script in Outlook > Tools > Macros , it just seems to loop round and round within the
    top function called Application_Startup () and never attempts the objInbox_ItemAdd() function which is the important part. Please can anyone say what is wrong.
    I'm putting all this code within Project1 > Microsoft Outlook Objects > This OutlookSession - I bet I'm putting all this code in the wrong place aren't I? Please help anyone.
    Dim WithEvents objInbox As Outlook.Items
    Private Sub Application_Startup()
    Set objInbox = Session.GetDefaultFolder(olFolderInbox).Items
    End Sub
    Private Sub objInbox_ItemAdd(ByVal Item As Object)
    If Item.Class = olMail Then
    If Item.Attachments.Count > 0 Then
    Dim objAttachments As Outlook.Attachments
    Set objAttachments = Item.Attachments
    For Each objAttach In objAttachments
    ' Does not handle duplicate filename scenarios
    objAttach.SaveAsFile "C:\temp" & objAttach.FileName
    Next
    Set objAttachments = Nothing
    End If
    End If
    End Sub
    Also, I've set the Security to Low within Outlook > Tools> Macros > Security and a bit baffled why this won't run.
    Just for info, I got this VBScript solution from:-
    Outlook Visual Basic for Applications Rules
    Kind Regards
    Matt
    p.s I'm stuck with Outlook 2000 due to a limitation with some Legacy software that my company is still using.

    Thanks jrv.
    At the moment - I don't have the time to learn VBA better along with learning the other things I have an intested in already (e.g. PowerScript) - My customer has an outstanding fault which need fixing urgently. I've spent about 5 hours so fa trying to get
    a VBA script to work withing Outlook but to no avail. I might ask around my company to see if any one else can help or post this on a non-Microsoft forum I think.
    Cheers all the same
    Matt
    So you sold a job to do something you do not knowhow to do.  You are getting paid.  It is your job to learn or to hire someone with the skills you have sold.  We cannot produce custom scripts for an obsolete version of Outlook 2000.. 
    O2000 is almost 15 years old. It is not secure as no security patches have been released for it for almost 10 years.  It is old technology which none of us care to remember unless you want to pay us for the assistance.
    Here is the link to the instructions in th KB that you completely ignored:
    http://support.microsoft.com/kb/235852/EN-US
    It shows you exactly how to do this in Outlook 2000.  You must read all of the instructions carefully.  YOu must try all example code and be sure you understand how it works.  Post all issues with how to use VBA in the Outlook VBA developers
    forum AFTER you have tried that code and have a specific question and not just a requirement for someone to fix this for you.
    The code in the article is explicit to Outlook 2000.  The code you are using is only usable in Outlook 2002 and later.,  You must follow the examples for Outlook 2000 as outlined in your original article.
    If you want to be a technician you need to learn all of these things.  Just knowing how to install a PC is not sufficient if you are going to be a contractor.
    VBA is VBA.  Posting here will not change that.  This is an Admin scarping forum and not an office VBA forum.  VBA is NOT VBScript.  No matter how much it looks like VBScript it is not.
    You cannot just copy VBScript into a VBA module and expect it to work. 
    You have sold the job of a programmer and Outlook developer with no skills in that area.  Is that fair to your customer?
    There are hundreds of skilled developers who have spent good money and time learning to do these things. You cannot just past some things you found on the Internet into a file and ask someone to fix it for you. 
    Start by learning the difference between script and VB.  Next you need to learn what an event is and how it is generated.  The code you posted does nothing in Outlook because it is not Outlook code.
    No.  I am not picking on you.  I am trying to get you to wake up and spend time learning your profession.  It is a lot of fun and actually pretty easy but only if you do your homework.
    ¯\_(ツ)_/¯

  • How to regain access to public folder items

    Hi All,
    We have a few public folder items (mainly calendars) for which i (the admin) have no(or limited) access to.
    In outlook 2010 if i go to the properties of the public calendar i can only see an entry for Administrators for which has the access of only "Author"
    If i log into the exchange server powerscript shell and try and run
    Get-PublicFolderClientPermission -Identity \"<Item name>"
    I get the following error:
    No existing 'PublicFolderEntry' matches the following Identity: '\<Item name>'. Make sure that you specif
    ied the correct 'PublicFolderEntry' Identity and that you have the necessary permissions to view 'PublicFolderEntry'.
        + CategoryInfo          : NotSpecified: (0:Int32) [Get-PublicFolderClientPermission], MapiObjectNotFoundException
        + FullyQualifiedErrorId : C8510C4,Microsoft.Exchange.Management.MapiTasks.GetPublicFolderClientPermission
    These are items have had existed in exchange since before it started and from Exchange 2003 to now Exchange 2010.
    Is there a way i can force the Administrator to have Owner rights on these items again?
    Thanks

    Ok... for all those other unfortunate souls out there who have no answer... here's the deal... The "Failed to Modify MAPI.NET Table" error is due to a problem with your DACL (permissions) table on the public folder(s). But, Exchange 2010 doesn't provide
    any utilities to correct this! exFolders replaces most PVDavAdmin functions but is does not have the "Fix DACL" option built in.
    After all my research and troubleshooting I discovered that the DACL issue was because I had entered explict permissions for the built-in Administrators group. This was resulting in the following error in event viewer: "The mailbox '' contains a folder <NAME
    OF MY PUBLIC FOLDER> with a security descriptor that violates the canonical format."
    Since I could not remove the existing public folders OR modify their permissions, but could still read their content, I copied all the content over to my mailbox. I then wanted to start completely fresh and created a new public folder store following the
    below steps:
    1. Dismount public folder database
    2. Move public folder database file and log (as a backup, not going to reuse it though)
    3. Mount public folder database (creates a new blank public folder database)
    *** NOTE: I could have probably just continued with the new blank public folder database, but I wanted to clear out all the old stuff and be sure it was all new and clean. So I continued through the following steps.
    4. Delete public folder database
    5. Delete database file and log files
    6. Opened ADSIEdit and deleted the existing "Folder Hierarchies" object from this location: Configuration\Services\Microsoft Exchange\<organization name>\Administrative groups
    *** NOTE: The next two steps are optional, as Exchange will do them for you when you create a new public folder database. BUT, exchange does NOT correctly assign the msExchPublicFolderTreeContainer class to the Folder Hierarchies object! It just makes it a
    container. So I opted to manually create it to force it to use the right class
    7. Recreated the "Folder Hierarchies" object in the same location (class is msExchPublicFolderTreeContainer)
    8. Create "Public Folders" object under "Folder Hierarchies" (class is msExchPFTree and attribute msExchPFTreeType MUST be set to 1)
    9. Went back to EMC, Organization Configuration, Mailbox, Database Management, and right clicked to create a new public folder database.
    10. Restart Information Store Service
    Once I had done all that I opened up outlook and created a new public folder. I then highlighted all the items in my mailbox that I had copied out of the original folder and copied them into this new public folder. As long as I do not add public folder permissions
    for the built-in Administrators group, then I am able to manage public folder permissions without any errors. I haven't tested to see if the same error occurs for other built-in security groups.

  • Reports Server - dynamic reconfiguration needed for long-running reports

    We have a need to permit users to submit large reports via scheduler from the hours of 8 pm to 2 am.
    These reports currently fail due to the daytime configuration limits on the row count and the elapsed time.
    I guess effectively we need to stop, change the config, and restart the reporting servers to expand the day-time row and elapsed time limits that are imposed.
    Can this be done thru the CMC API or is there a better way to accomodate this need via Powerscript or some other mechanism ?

    Hi,
    these Groups are virtual. You dont need any additional Hardware. The callenge here would be that you cant switch them on or off. If they activated they are activated.
    The only thing i could imagine would be custom code which enables the servers and disable the servers. This would be customization, no default options are here available.
    Regards
    -Seb.

  • The Document Information Panel was unable to load. The document will continue to open ?

    I am using Sharepoint 2010; DIP in microsoft word all the while is working fine, not sure why suddenly it came out the following error when save word doc  into sharepoint.
    ERROR MESSAGE
    ===========
    "The Document Information Panel was unable to load. The document will continue to open.
    The form contains schema validation errors.
    Content for element 'documentManagement' is incomplete according to the DTD/Schema. "
    How to troubleshoot? Recently I added lookup column and a workflow into the library, but I did the same thing in another library which never appear to have any issue on it.

    The lookup column is creating the problem , you can find powerscript solution to fix this issue , please check this -
    Fix through Powershell
    http://blogs.msdn.com/b/tehnoonr/archive/2012/05/17/sharepoint-2010-document-information-panel-fails-to-load-when-office-documents-are-opened-in-a-library-that-contains-lookup-columns.aspx
    Fix through Code
    https://social.msdn.microsoft.com/Forums/office/en-US/2a4d6d10-d1d5-4d6a-a22b-62dfb6b60685/lookup-field-creation-and-document-information-panel?forum=sharepointdevelopmentlegacy
    or try this -
    https://social.technet.microsoft.com/Forums/office/en-US/2552fbc8-da24-4d2b-84f6-d39c4d58b137/the-document-information-panel-was-unable-to-load-the-document-will-continue-to-open-for-more?forum=sharepointgeneralprevious
    1. Open this location- C:\Program
    Files\Microsoft Web Designer Tools\Office12\1033\IPEDINTL.DLL
    2. copy IPEDINTL.DLL
    3. paste it here- C:\Program Files\Microsoft
    Office\Office12\1033\IPEDINTL.DLL
    4. Close all the applications that are presently
    open as well as all the browsers
    5. Open the sharepoint site in a new browser
    and check the results !!
    Thanks
    Ganesh Jat [My Blog |
    LinkedIn | Twitter ]
    Please click 'Mark As Answer' if a post solves your problem or 'Vote As Helpful' if it was useful.

  • How to get all data in a section from profile file?

    Suppose I have profile ini have a section like:
    [Mysection]
    k1 =v1
    k2=v2
    the key-value pair could be dynamically in this section. then I want to get all data in Mysection.  How can I get it in a loop for all in powerscript?

    This is what you need:
    integer     li_fhandle, li_rcode = 1, li_sfound = 0, li_idx = 0, li_eqpos, i
    string ls_filename = 'C:\app.ini'
    string ls_line, as_key[], as_val[]
    string ls_section = '[General]'
    // OPEN INI FILE
    li_fhandle = FileOpen(ls_filename, LineMode!)
    IF IsNull(li_fhandle) OR li_fhandle < 1 THEN
      // DO NOTHING
    ELSE
      DO WHILE li_rcode > 0
      li_rcode = FileRead(li_fhandle, ls_line)
      IF li_rcode > 0 THEN
      IF POS(ls_section, ls_line) > 0 THEN
      li_sfound = 1
      CONTINUE
      END IF
      IF li_sfound = 0 THEN CONTINUE
      IF POS(ls_line, '[') > 0 AND POS(ls_line, ']') > 0 THEN EXIT
      li_eqpos = POS(ls_line, '=')
      li_idx++
      as_key[li_idx] = MID(ls_line, 1, li_eqpos - 1)
      as_val[li_idx] = MID(ls_line, li_eqpos + 1)
      END IF
      LOOP
    END IF
    FOR i = 1 TO li_idx
      messagebox('Key - Value',as_key[i] + ' = ' + as_val[i])
    NEXT
    // CLOSE INI FILE
    IF li_fhandle > 0 THEN
       FileClose(li_fhandle)
    END IF
    Adapt it to your needs... you probably should make it a function.

  • Looking into UCS. Do I need UCS Director?

    Hello Everyone
    I am brand new to UCS.  I am getting quotes from Cisco on new UCS system.  About a year ago we got quotes for this system to add to next years budget and on this quote there is a new item and that is about 10K for UCS support package.
    In reading about this it sounded like this was for really large environments.  
    Our environment is going to be one chassis and 8 blades.  5 of the blades will be used for Hyper V cluster which is managed by SCVMM and orchestrator for automation.  In a few years we may look into getting another system for failover site.
    Changes on VM environment are not frequent.  About 100 VMs
    Thanks 

    In your environment (almost static), UCS Manager (which doesn't require a license, bundled with fabric interconnect) is ok.
    UCS Director (the name is misleading) allows automatic provisioning and automation of the infrastructure (Ethernet and Fibrechannel switches, UCS, storage).
    In your case with a Windows Hyper-V environment, I would recommend to look into Powershell / Powerscripts. UCS has a library of around 1800 commandlets; its free of charge.
    Everything you can do with GUI (UCSM), can be done with PS scripts.
    http://www.thomasmaurer.ch/2013/08/manage-your-cisco-ucs-with-windows-powershell/
    http://www.thomasmaurer.ch/2013/10/cisco-ucs-powershell-convertto-ucscmdlet/

  • Export and Import members of a Software Update Group

    Greetings,
    I am looking for a method I can use to Export a Software Update Group (or just it's members) to a file that I can then use to Import into another 2012 hierarchy. I can't use the built-in Migration process as it is already connected to a different Hierarchy.
    I have scripts that will pull Approvals from WSUS and then import into Update groups, but I also need something that I can use to copy update groups from "DEV" to "PROD" and back again.
    Any thought or suggestions most welcome.
    Scott.

    Hi
    You cannot export Software Update Groups in ConfigMgr 2012.
    One way of doing what you what is to use Powershell to "dump" all the settings of your Software Update Groups and then use that file as a basis for creating the Software Update Group in production. Or you could just create all Software Update Groups using
    a Powerscript which runs in dev and production.
    To get you started, you could look at the snippet of code below, which I use for creating Software Update Group automatically.
    import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
    $PSD = Get-PSDrive -PSProvider CMSite
    CD "$($PSD):"
    $DPDate = get-date "22-02-2011 19:00:00"
    $SUGName = "Workstaitions 2011 02 February"
    $SUGMembers = Get-CMSoftwareUpdate | Where-Object {$_.DatePosted -eq $DPDate -and $_.NumMissing -ge 1} | select CI_ID
    New-CMSoftwareUpdateGroup -Name $SUGName -UpdateId $SUGMembers.CI_ID

  • Increase bScale in DBPARAMBINDINFO Error in PB 12.1 Ver 7000

    Hello.  Can't seem to get around the below error in PB 12.1 Ver 7000 when calling a Stored Procedure from Powerscript and am passing Datetime values.  I have played around with the connection strings Date formatting, but no matter what I attempt, it still looks like the PB is passing MM/DD/YYYY HH:MM:SS when SQL Server 2012 is expectring YYYY-MM-DD HH:MM:SS.
    Full error:
    SQLSTATE = 22007
    Microsoft SQL Server Native Client 11.0
    The fractional part of the provided time value overflows the scale of the corresponding SQL Server parameter or column. Increase bScale in DBPARAMBINDINFO or column scale to correct this error.
    I've tried to use providers of SQLOLEDB, SQLNCLI10 & SQLNCLI11
    Connection Profile String (Connection works fine):
    // Profile for SIngle Sign On....
    SQLCA.DBMS = "OLE DB"
    SQLCA.Lock = "RU"
    SQLCA.AutoCommit = False
    SQLCA.DBParm = "PROVIDER='SQLNCLI11',DATASOURCE='DB-DNS-ENTRY',PBCatalogOwner='dbo',INTEGRATEDSECURITY='SSPI'"
    In the above, I have also tried to specify the following, whcih also works, but the same result (notice the date parameters match what SQL Server should expect for Datetime data types...
    // Profile
    SQLCA.DBMS = "OLE DB"
    SQLCA.LogPass = <**************>
    SQLCA.LogId = "USERID"
    SQLCA.Lock = "RU"
    SQLCA.AutoCommit = False
    SQLCA.DBParm = "PROVIDER='SQLOLEDB',DATASOURCE='DB-DNS-ENTRY',PROVIDERSTRING='Database=DB-NAME',DateFormat='yyyy-mm-dd',DateTimeFormat='yyyy-mm-dd hh:mm:ss.fff',TimeFormat='hh:mm:ss.fff'"

    Ok, I think that I found the issue.  I did not apply any more changes to the DB Profile.  Our app is over 15 years old and many hands at varying times have made modifications.  I was working on a workaround to our DBPARAMBIND problem by modifying the Stored Procedure and what parameters it expected (limiting datetime parameters), but the code was not "pulling in" or recognizing the latest changes I made. It turns out that the following style of code to invoke a Stored Procedure was not pulling in the most recent version of the SP:
    SQLCA.PROCEDURE_NAME(ld_param1, ld_param2, ldt_param3...)
    I am not sure what version of Stored Procedure it was invoking??  Only then did I attempt to rewrite the call to what I was familiar with in the following format:
    Declare pb_procedure_alias procedure for PROCEDURE_NAME &
    @param1 = ld_param1,
    @param2 = ld_param2,
    @param3 = ld_param3 USING SQLCA;
    Execute pb_procedure_alias;
    The DBPARAMBINDINFO error disappeared.  Original problem solved, no need for a workaround.
    Not sure if this issue is a result of our move to SQL Server 2008 and then to 2012 and still using an older version of Powerbuilder (12.1 Build 7000)???
    Explanations???

  • The specified user domainname\user1 could not be found;

    hi,
     am writing script for adding the users into site collec admin group.till last week this code was working fine. but from yesday onwards, am getting this error. this user already exists in the farm and AD. etc... 
    thanks to Simon Doy,. i took refer.from his code: 
    http://blog.ithinksharepoint.com/2014/05/30/powershell-script-add-user-as-site-collection-admin-to-all-sites-in-web-application/
    Add-PSSnapIn Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
    $MasterUsernames =  "in\userB#in\userC#in\userA;
    $UsersNamesArray= $MasterUsernames.Split('#')
    $siteCollection = Get-SPSite  "http://srvr1:123/sites/engg/"
    Write-Host "Setting up user $MasterUsernames as site collection admin for $siteCollection.Title  " -ForegroundColor White; 
       foreach($singleUserName in  $UsersNamesArray)
             #$userToBeMadeSiteCollectionAdmin = $siteCollection.RootWeb.EnsureUser($Username); 
             $userToBeMadeSiteCollectionAdmin = $siteCollection.RootWeb.EnsureUser($singleUserName); 
             if($userToBeMadeSiteCollectionAdmin.IsSiteAdmin -ne $true)
                       Write-Host "$singleUserName is not site admin"
                      #pause
                       $userToBeMadeSiteCollectionAdmin.IsSiteAdmin = $true;
                       $userToBeMadeSiteCollectionAdmin.Update();   
                      Write-Host "User is now site collection admin for $siteCollection" -ForegroundColor Green;
           else  
                Write-Host "User is already site collection admin for $siteCollection" -ForegroundColor DarkYellow; 
     Write-Host "Current Site Collection Admins for site: " $siteCollection.Url " " $siteCollection.RootWeb.SiteAdministrators;
    can anyone pls  point me  why am getting this error suddenly.this is working code and am getting this error only for a particular user.
    am getting this error.
    Exception calling "EnsureUser" with "1" argument(s): "The specified user domainname\userA;
     could not be found."
    At C:\powerscripts\AddUsers_SiteCollecAdmin.ps1:20 char:10
    +          $userToBeMadeSiteCollectionAdmin = $siteCollection.RootWeb.EnsureUser($ ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : SPException

    Hi Sadomovalex,
    am using Windows Claims only, not FBA.the issue started only 2 days back. it was working fine till last week.
    note: i was creating site collections with dedicated content db through powershell and adding metadata , contents types, doc libs, association etc etc kind of jobs. After end user found some bugs in my site collec .we thought of dropping the site collec
    and db and recreate it again. this was repepated multiple times. 2 days back i was performing this - recreatng the  same sitecollec and content db - [ after deletion ] it recreated. and end user came to me for adding few members as sitecollec
    admin.s since this is a routine task, i wrote this powershell. 

  • Convert C# to PowerBuilder Classic 12.5

    Hi Everyone, 
    I need some help, how to convert following C# code into 
    powerscript in
    PowerBuilder Classic 12.5:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using Autodesk.AutoCAD; //申明CAD空间
    using Autodesk.AutoCAD.Interop;
    using Autodesk.AutoCAD.Interop.Common;
    //测试环境 AutoCAD12
    //引用版本 AutoCAD 2012 Type Library
    //引用DBX版本 AutoCAD/ObjectDBX Common 16.0 Type Library
    //引用 Microsoft.VisualBasic.dll
    //不要开其它版本测试
    namespace WindowsFormsApplication1
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    Autodesk.AutoCAD.Interop.AcadApplication AcadApp; //申明CAD
    Autodesk.AutoCAD.Interop.AcadDocument AcadDoc; //申明文档
    private void Form1_Load(object sender, EventArgs e)
    private void button1_Click(object sender, EventArgs e)
    double[] Po =new double[3]{0, 0, 0}; //默认起点
    // 循环使用多个点时,后面将Pt的值给到Po;
    AcadApp = (AcadApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("AutoCAD.Application");
    Microsoft.VisualBasic.Interaction.AppActivate(AcadApp.Caption); //激活当前打开的CAD图档
    AcadDoc = AcadApp.ActiveDocument; //将文档移动当前激活的图档
    Object Vart = AcadDoc.Utility.GetPoint(Po, "请拾取坐标点:"); //定义用户选取的点坐标对象
    double[] Pt = (Double[])Vart; //将制将点对象转化为双精度数值
    textBox1.Text =Pt[0].ToString(); //将双精度数值转为字符串,传回窗体
    textBox2.Text = Pt[1].ToString();
    textBox3.Text = Pt[2].ToString();
    Thanks
    regards

    Hi,
    This forum is used to discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including
    Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.
    For issues regarding PowerBuilder, I suggest you posting it to:
    http://nntp-archive.sybase.com/nntp-archive/action/product/detail/14;jsessionid=FED3145DF733FA41C79082C58F081210
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • PB 12.6 (build 3506) Application Exit Codes

    Environment:  Windos 2012 R2 Server,
    PowerBuilder 12.6 Build 3506
    Building 32 bit application
    I've got a utility application that's running as a service.  We're using NSSM (the Non-Sucking Service Manager) to run the program.
    NSSM can take actions depending on the exit code.
    In earlier versions of PowerBuilder I could accomplish this by setting Message.LongParm in the application close or application system error event.
    Now, that's not working and the advice I'm seeing tends more toward
    // External FUNCTION declaration
    SUBROUTINE ExitProcess(ulong uExitCode) LIBRARY "kernel32.dll"
    // Powerscript
    ExitProcess(50)
    But that seems like it terminates the application and any clean up that might have occurred with a normal application exit isn't going to happen.
    my question is...
    Is this really my only option or is there some other way I have not been able to find?
    Secondary concern.. where do I find the full 12.6 manuals?  I keep ending up at SyBooks which only has documentation up to 12.0 and SAP PowerBuilder 12.6 – SAP Help Portal Page only gives me the new feature guide, installation and release notes, but not the actual documentation.

    I am sorry if I somehow led you to think NSSM is the problem.  It's not, PowerBuilder is.
    The PROBLEM restated for clarity:
    In earlier versions of PowerBuilder I could add code to the application close event that set Message.LongParm to a value and then that value would be accessible to a command file via the ERORLEVEL system variable.
    In my current tests with PowerBuilder 12.6, setting Message.LongParm is not working so I Googled the problem and the advice I'm seeing tends more toward using:
    // External FUNCTION declaration
    SUBROUTINE ExitProcess(ulong uExitCode) LIBRARY "kernel32.dll"
    // Powerscript
    ExitProcess(<Value>)
    But that seems like it terminates the application and any clean up that might have occurred with a normal application exit isn't going to happen.  That's not ideal.
    My Question is:
    Is there any method exiting that will allow me to set that system ERRORLEVEL variable that does not require my causing an abnormal termination to my application?
    Or is using the external function ExitProcess really my only option?

  • Creating/Working With Nullable Objects in PowerShell - How?

    Hi,
    how do I create and work with Nullable objects in PowerScript.
    None of the tips I found worked:
    > ([System.Nullable[System.Int32]]1).GetType().Name
    Int32
    > ([System.Nullable[System.Int32]]$null).GetType().Name
    You can't call a method on a null value expression.
    > (New-Object System.Nullable[Int32] 1).GetType().Name
    Int32
    Any help is appreciated!

    Well, nullable: yes, but Nullable: no.
    this is what I get in .NET if I call GetType() on a variable of type Nullable[Int32]:
    int? a = null; a.GetType();
    {Name = "Nullable`1" FullName = "System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}
        [System.RuntimeType]: {Name = "Nullable`1" FullName = "System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}
        base {System.Reflection.MemberInfo}: {Name = "Nullable`1" FullName = "System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}
        Assembly: {mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
        AssemblyQualifiedName: "System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        Attributes: Public | SequentialLayout | Sealed | Serializable | BeforeFieldInit
        BaseType: {Name = "ValueType" FullName = "System.ValueType"}
        ContainsGenericParameters: false
        DeclaringMethod: "(typeof(int?)).DeclaringMethod" hat eine Ausnahme vom Typ "System.InvalidOperationException" verursacht.
        DeclaringType: null
        FullName: "System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"
        GenericParameterAttributes: "(typeof(int?)).GenericParameterAttributes" hat eine Ausnahme vom Typ "System.InvalidOperationException" verursacht.
        GenericParameterPosition: "(typeof(int?)).GenericParameterPosition" hat eine Ausnahme vom Typ "System.InvalidOperationException" verursacht.
        GUID: {9a9177c7-cf5f-31ab-8495-96f58ac5df3a}
        HasElementType: false
        IsAbstract: false
        IsAnsiClass: true
        IsArray: false
        IsAutoClass: false
        IsAutoLayout: false
        IsByRef: false
        IsClass: false
        IsCOMObject: false
        IsContextful: false
        IsEnum: false
        IsExplicitLayout: false
        IsGenericParameter: false
        IsGenericType: true
        IsGenericTypeDefinition: false
        IsImport: false
        IsInterface: false
        IsLayoutSequential: true
        IsMarshalByRef: false
        IsNested: false
        IsNestedAssembly: false
        IsNestedFamANDAssem: false
        IsNestedFamily: false
        IsNestedFamORAssem: false
        IsNestedPrivate: false
        IsNestedPublic: false
        IsNotPublic: false
        IsPointer: false
        IsPrimitive: false
        IsPublic: true
        IsSealed: true
        IsSecurityCritical: false
        IsSecuritySafeCritical: false
        IsSecurityTransparent: true
        IsSerializable: true
        IsSpecialName: false
        IsUnicodeClass: false
        IsValueType: true
        IsVisible: true
        MemberType: TypeInfo
        Module: {CommonLanguageRuntimeLibrary}
        Namespace: "System"
        ReflectedType: null
        StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}
        TypeHandle: {System.RuntimeTypeHandle}
        TypeInitializer: null
        UnderlyingSystemType: {Name = "Nullable`1" FullName = "System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}
    That's quite a difference to PowerShell's:
    ([System.Nullable[System.Int32]]$null).GetType()
    You can't call a method on an expression with value NULL.
    See my point? PowerShell apparently doesn't have a notion about Nullable types. That's what I need to find out for myself: "Why?"
    Best regards,
    Axel Dahmen

  • X200 with external 20" 16:9 monitor

    I bought a new LCD monitor few days ago and it's resolution is 1600*900
    However, I can't find the native resolution from the display properties.
    The resolutions which my x200 can provide are 1440*900, 1600*1200, 1680*1050 but there is no 1600*900...
    I use different method to solve the problem such as updating the LCD and VGA drivers, using "powerscript", modifying the EDID information but they still don't work.
    Does anyone can help me solve the problem?
    Model: X200 7458-pj9
    OS: Windows XP
    LCD : ASUS VH202T

    I use vga output on my x200.
    I uncheck "Hide modes that this monitor cannot display" option...but the resolution which my system can provide are
    1600*1200,
    1680*1050,
    1920*1080,
    1920*1200
    no 1600*900....
    I updated my BIOS to 3.10 but the result is still sad.. 

Maybe you are looking for

  • Automator in Lion not working as before in 10.6/10.5

    Hai! Asking Google it seems I am the only having problems with Automator post upgrade from 10.6.8 to 10.7.1. I have a workflow used as a folder action that should print PDFs downloaded to the downloads folder and with a certain file naming scheme to

  • PS CC not compatible with Yosemite?

    I just have installed PS CC. But it cannot start. Doesn´t it work with Mac OS Yosemite?? Regards, Michaela

  • Where to buy

    Where's the best place to get this iPod- best buy, apple store, apple store online, etc.?

  • Interest compounding starting at a certain date

    Hi folks, I'm working on a small applet, and I was seeking a bit of guidance before I jumped in too deep into it. In itself, it's pretty simple. I have an initial dollar figure, and it's growing by x every second. It started a few days ago, and I wou

  • Username and Password Not Being Saved

    The option to save my username and pw is not coming up on my banking site, Wells Fargo. I get the option on other sites, I just set up FF. Also, does FF have a Key Logger Security option?