473,385 Members | 1,267 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

trying to use an i subscript

489 256MB
I'm trying to convert the following statement to use an I subscript. I goes from 1 to 18.
Expand|Select|Wrap|Line Numbers
  1. TTime1 = Round((Time1 + (Misses1) * mtime) + ((Penelties1) * Ptime) + ((MSafety1) * MStime) - Bonus1,2)
In using the following
Expand|Select|Wrap|Line Numbers
  1. me("ttime" & I) = round((("Time" & I) + ((("Misses" & I)) * mtime) + ((("Penelties" & I)) * ptime) + ((("MSafety" & I)) * mstime) - ("Bonus" & I), 2)
I get no errors until I run the code and them I getting a type mismatch on the Me("ttime" & I) and I can't figure out if there is a way to do this.
Oct 6 '17 #1

✓ answered by CD Tom

ok I did get this to work. I ended up using the file name instead of the me( I added the file name here's the code that worked.
Expand|Select|Wrap|Line Numbers
  1. rsset.Edit
  2. rsset("ttime" & i) = Round(rsset("Time" & i) + ((rsset("misses" & i)) * mtime) + ((rsset("Penelties" & i)) * ptime) + ((rsset("MSafety" & i)) * MSTime) - rsset("Bonus" & i), 2)
  3. rsset.Update
  4.  

6 1567
NeoPa
32,556 Expert Mod 16PB
Have you typed this out instead of COPYing it in Tom. The message doesn't match the code, which uses an asterisk (*) and not the ampersand (&).
Oct 6 '17 #2
CD Tom
489 256MB
Yes I did type it in I tried to copy but wouldn't, it should be the &
Oct 6 '17 #3
CD Tom
489 256MB
ok I did get this to work. I ended up using the file name instead of the me( I added the file name here's the code that worked.
Expand|Select|Wrap|Line Numbers
  1. rsset.Edit
  2. rsset("ttime" & i) = Round(rsset("Time" & i) + ((rsset("misses" & i)) * mtime) + ((rsset("Penelties" & i)) * ptime) + ((rsset("MSafety" & i)) * MSTime) - rsset("Bonus" & i), 2)
  3. rsset.Update
  4.  
Oct 6 '17 #4
NeoPa
32,556 Expert Mod 16PB
I'm glad you got it to work Tom, but totally intrigued by the idea that the copy wouldn't work. It's so important a concept when using forums that I shudder to think people can post questions without the ability to COPY and PASTE. I've been involved in many threads where that's not been used and the amount of time wasted is barely believable. That's both posters' and experts' time so nobody wins.
Oct 6 '17 #5
CD Tom
489 256MB
What's funny is I did a copy and paste into a word document and that worked from my code, then did a copy and paste from the word document and it worked. Don't know why it wouldn't work from my code.
Oct 7 '17 #6
NeoPa
32,556 Expert Mod 16PB
That's a different question Tom, but I'll give you that as a freebie - The code window uses UNICODE and can play badly with some other apps. Copying it via a text editor is the most reliable way to get that done. Skype has a similar problem dealing with text copied across from the VBA window.
Oct 7 '17 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: andy.rich | last post by:
I am getting the following error and I do not know why. Can anyone help? -------------------------------------------------------- this is what appears on the screen...
15
by: Steve | last post by:
Hi, I hope someone can help. I have a class called cField, and another class called cFieldList. cFieldList contains a std::vector of cFields called myvec I've overloaded the subscript...
5
by: Steve | last post by:
Hi, I have a class called cList as so: template<class T> class cList { // base class for Lists private: protected: vector<T> tListOf; // field list container public: void Add(const T& t)...
42
by: Martin Jørgensen | last post by:
Hi, I'm trying to move a matlab program into c language. For those who knows matlab, this is the line I want to program in c: hx(1:nx,1:ny) = 0; % nx=10, ny=10 It works on a 2-dimensional...
51
by: Pedro Graca | last post by:
I run into a strange warning (for me) today (I was trying to improve the score of the UVA #10018 Programming Challenge). $ gcc -W -Wall -std=c89 -pedantic -O2 10018-clc.c -o 10018-clc...
6
by: josh | last post by:
Hi I've a dubt! when we have overloaded functions the compiler chooses the right being based on the argument lists...but when we have two subscript overloaded functions it resolves them being...
3
by: uche | last post by:
Please give me some feed back on this issue: Here is the complier error: hexdmp.cpp: In function `void output(unsigned char, int, bool&)': hexdmp.cpp:133: error: invalid types `unsigned char'...
4
by: Han | last post by:
when I exe my project in vs.net2005,I got the error following: Debug Assertion Failed! Program:........ File:c:\program files\microsoft visual studio 8\vc\include\vector Line:756 ...
13
by: Ivan | last post by:
Hi, What is the best syntax to use a char to index into an array. /////////////////////////////////// For example int data; data = 1;
19
by: C++Liliput | last post by:
I have a custom String class that contains an embedded char* member. The copy constructor, assignment operator etc. are all correctly defined. I need to create a map of my string (say a class...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.