Infinite Addition Loop - vb.net

I basically have 4 tags that keep a count of product produced within the company. The problem is that the logic behind these tags is to reset the value when the machine stops. I am not too familiar with coding, but am trying to develop a calculation tag that will just keep a running count without reset. So basically, the number would always escalate.
Tag Names : Filler1Count , Filler2Count, Filler3Count, Filler4Count
This is all done in an application called Historian Administrator. VB code can be implemented behind tags. I will obviously be keeping the original tags, but have the option of making a calculation tag.

Watch for when the number is smaller than the previous poll and store your total in a different variable.
If Filler1Count < LastFiller1Count Then
Filler1Total = Filler1Total + LastFiller1Count
End If
LastFiller1Count = Filler1Count
Total = Filler1Total + Filler1Count

Related

<screen scraping in uipath> combine split numbers

I would like to screen scrape a few user details including the handphone no. from one application and paste the details into another application. There's a spacing in the handphone no. e.g. 8123 4567. I would like to remove the spacing and paste 81234567 into the other application.
I have use Build Data Table and Write Range to store the captured information in. In the handphone no. screen scrape activity, I did the following additional steps to split the numbers and combine them into 1. It works the first few times but when I tried running the script a few days later, it stopped working. Basically, the handphone no. is not completely copied over. Sometimes it returns as 8123 and sometimes as 812.
Assign
ArrayHandphoneNo = HandphoneNo.Split({" "},stringsplitoptions.None)
Assign
HandphoneNo = ArrayHandphoneNo(0)
Try Catch
HandphoneNo = HandphoneNo + ArrayHandphoneNo(1)
Catches exception
Assign
HandphoneNo = HandphoneNo
May I know what went wrong?
Why you having a workaround. From my perspective you simply need a line of code that is removing all spaces. So you get back the full digit number. So try with this:
myString = myString.Replace(" ", "")
in your assign activity.
Could look like this one:

How to safely increment database using django rest framework?

I'm facing some troubles by trying to make a like/unlike system for my app.
It's okay when i like/unlike in a normal timelapse, but when i click multiple times in a very short frequency (20 clicks in 10 seconds for example) then my counter is disturbed.
Normally while i'm testing my counter should always have a value of 1 or 0 since i am the only one to do the operation. However when i click quickly and multiple times, my rest api cannot follow the rythm and i'm getting a counter that have 7 or 8 likes.
I've tried multiple solutions. first by adding the model transaction included with django. As a decorator :
#transaction.atomic
Or manually :
with transaction.atomic():
#do stuff
I've also tried to increment directly from the database by using F() :
votes=F("votes") + 1
Nothing seems to work.
Any suggestion ?

How to control the flow of tasks within SSIS

I have a series of 5 tasks, and would like guidance on how to run them in a specified order:
The order that I need:
Run the entire series.
And then only run these:
I checked out this and this resource, but am not sure how to apply them.
I would put all those tasks inside a For Loop Container. The iterations would be controlled by a simple Counter variable and limited for values 1 to 2.
Then for the last two tasks, I would set the Disable property using an expression, e.g.
#[User::Counter] == 2

How to get OrderNumber in Sage Accpac after entering order with macro script

I have recorded the process to create an order and quote in Sage ACCPAC, and i put the code in a VB 6 application, it works perfectly and adds a new quote / order. But what i need is that i want to get the generated ordernumber or orduniq within the same code , I want to perform some operations on that quote. But i am not sure, how can i get the information from accpac, as what i have done till now is simply recorded a macro and then copied the code and put it into VB application. I got the session creating code from a site, and made the Macro code dynamic and the application is ready to accept parameters and create an order on that basis , Kindly tell me how can i return the created ordernumber back to the user.
Thanks
Agree with enterland - always good to post code here. However, in this case I know what you're looking for. Once you create the order you can get the order number from your order header view. Along these lines:
OEOrderHeader.Insert
NewOrderNumber = OEOrderHeader.Fields("ORDNUMBER").Value

How to use a hidden page item within an SQL report query without submitting

Using: Oracle ApEx 3.0.1
I have a SQL report region that contains a hidden page item as part of the "where clause". My problem is, based on a value entered by the user, I need to assign this value entered to my hidden item, so that it can be used within the where condition of my SQL but this would need to be done without actually submitting the form.
At the moment, I can set the value via an on-demand process but my SQL is still not returning any values as the hidden page item within the query is not set (as page has not been submitted).
I am not sure how to do this and whether in actual fact, this is possible to do, without having submitted the page.
Since you are on Apex 3, you don't have dynamic actions, but that doesn't hinder so much.
I've set up an example on apex.oracle.com. To get in the workspace, use workspace 'tompetrusbe' + apex_demo / demo.
There is a dynamic action there, which can do the work too, but i've disabled it.
What you need to make it work:
an ajax callback process, with the following line:
apex_util.set_session_state('P2_PAR_ENAME', apex_application.g_x01);
Give your report region a static id, i called mine 'report_emp'. This so i can easily retrieve it.
In the javascript region of the page, you then need to call the app process, and then refresh the region. Also bind the event which needs to trigger this action. I've done it here through the onchange event of the parameter textfield.
function refresh_report(oTrgEl){
//alert('refresh: ' + $v(oTrgEl));
//calling the application process which sets the session state of P2_PAR_ENAME
var oGet = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=set_session_state', &APP_PAGE_ID.);
oGet.addParam("x01", $v(oTrgEl));
oGet.get(); //the app process just sets something, it returns nothing
//refresh the report region
$("#report_emp").trigger("apexrefresh");
};
function bind_events(){
//call this onload
$("#P2_PAR_ENAME").change(function(){refresh_report(this);});
};
In the query of the report i use where ename like '%'||UPPER(:P2_PAR_ENAME)||'%'.
When you type (for example) 'bl' in, and tab out (to trigger the onchange), the region will refresh and will be filtered.
You'll just need to adapt to your solution :)