Author Topic: incrementing values in variables  (Read 856 times)

Tags:
  • All members
  • Posts: 314
incrementing values in variables
« on: 22 Sep 2019, 16:24 »
Hi,

I am working on trying to get/set values within an excel sheet - I have started to ask the question elsewhere, so I won't go into detail here, BUT, I was looking to add in values, on a row by row basis, using a trigger expression sheet!A(cell_sheet_J1), where cell J1 holds a value indicating the current row that is empty in column A... Cell J1 contains a formula which will allow me to get the next empty cell available, and my intention is to write values in these empty cells, as they are created.

This didn't work, because, from a guess, I am assuming that MFP will not look at the incremented value, given by cell J1, and I assumed this because when my trigger wrote to a cell successfully, it was writing to the same cell/row, every time.

This made me think that I need to look at using a number within the trigger, to allow the writing of excel values into a cell, by using sheet!A(excel_row), where excel_row is a variable defined in the trigger...

This created a stumbler, because I do not know how to set a variable, and increment it on demand, by a trigger that adds a value to an excel cell..

So, I want to do a write to excel action, using sheet!A(excel_row) as the cell address, and immediately after this, I want to increment excel_row, in preparation for the next required entry...

I tried to set a user variable as excel_row, which I could query, and have this variable initially defined in Constants, with a value of 1, and further processing, have excel_row have a value as excel_row + 1...

In C#, this would be the same as writing : excel_row = excel_row + 1; or even just, excel_row++;

I can't explicitly set a value to a variable in this way through MFP, so I would like to know how I set an initial value, excel_row, and then increment it on command, after a new entry is added to the excel sheet...

These things are so trivial in coding that even a complete newbie would be expected to know how to do this, but in MFP, not so obvious...

Thanks for reading, any help appreciated

  • All members
  • Posts: 7
Re: incrementing values in variables
« Reply #1 on: 22 Sep 2019, 16:56 »
It seems you know how to program in C#, so why you need Excel worksheet?

  • All members
  • Posts: 314
Re: incrementing values in variables
« Reply #2 on: 22 Sep 2019, 17:32 »
StefanBelo,

without wishing to be rude, I am not really sure what relevance your question is here?

In case you didn't realise, I am trying to get help to do things within the trigger development of MFP. Along the way, I am giving comparisons, using my often used coding language, C#.

I can indeed code C# to do whatever I need with Excel, but that will be no help to me when I need to do things with the horses/football/dogs, and I need to have MFP do the things I need - I would really have no idea how to get the results from betfair, because I have not investigated, (nor do I intend to investigate) the betfair API, and why do that, when MFP will give me everything I need - the simple need I have, is how to set a value to a variable, and have some way to increment that value after each write to a cell/row of a sheet. I want to be able to query the NEXT row index, and assign that to a trigger to allow writing to that cell/row

So, no matter how good (or bad) I am at coding, it doesn't help me to achieve what I need from MFP. I am quite sure MFP can give me what I need in this instance, and my hope is that the experts here will assist me to do this. I am happy about my logic, but, my implementation of the logic in the triggers, does not work, which means I have something wrong, hence my question.

Hope we are clear?

 

Please note, BetFair is seems to be currently OFFLINE