How can a user enter data as many it was specified for??
I am writing a program that makes calculations on data entered by the user. First I ask the user how many inputs he/she wants. And my problem is how the user can enter as many input he/she asked for. How do I make the program ask for input more than once, before I do calculation on the entered data???
I am sorry if my english is hard to understand, but I hope this was understandable.
I think you should use a readInt() if you have such a method in your Keyboard class to ask for the numbers.
Then create a float array with that many elements, and use the for-loop you have shown:
for (...) {
numbers[ i-1 ] = Keyboard.readFloat(); // numbers is a float array
// if you let i go from 0 to i < tall, then you don't need to subtract 1 from i.
}
Similar Messages
-
How to use User entered dates in intreval
Hi,
User will enter date range in variable
As per my requirment i want to use no of days between those 2 user entered dates in my calculaction
How can i achieve this at report level.
ThanksHi
Create a variable with intreval.
There is a function module which calculates the no of days between the days
Go to SE38 and ZXRSRU01 Program
Write the Code like this (Not exact code) you can modify
WHEN "ZZZZZ"(Before that create a formula variable to get the number of days between the days and use the tech name of the formula variable here)
read ..the lower limit and the upper limit of the caldaz variable
FROMDATE = L_S_RANGE-low
TODATE = L_S_RANGE-HIGH
Then call the function module
Search for the function module by using days in SE37
Then pass the from and to Date to the function module it will retun the number of days
update that to table e_T_Range
You can proceed with this
Regards
M.A -
How to handle user entered data validation
Hi,
In my page i have three fields
Empname (String)
Empnumber (Number)
DOB (Date)
These fields are mapped to VO which are mapped to EO.
When user enters string in Empnumber field then it will throw user following Error "Cannot create an object of type:oracle.jbo.domain.Number with value hghfg"
I want to display above Error in user friendly fashion.
Where to do this and How to do this?
And i have one more question
can we handle all the exceptions in seter method of EOIMPL?
-Thanks
MithunSumit,
I have set 'Disable Client Side Validation' in the property inspector true for submit button. Added below code for validation
In CO
String lb_flag= (String)am.invokeMethod("validateRVSize",prm1,prmType1);
In AM
public String validateRVSize(String val)
String values = "1234567890' ";
for (int i=0; i < val.length(); i++)
if (values.indexOf(val.charAt(i)) < 0)
return "false";
return "true";
but what i have observed is control is not at all coming to process form request. it is doing it's validation in processformdata itself, i suppose.
because no statement is getting printed if i had entered characters in number field.
-Mithun -
How can I change the dates on many photos with a fix time of say 20s?
Before it was possible to change the date on many pictures scanned by adddind a fix increlental of time.
How can I now change the dates on many pictures taht I have renumbered to keep the same incremental?The seconds:
I just remembered - the time increment is set in Apple Script in seconds - the variable "minutes" is just a name for the value "60" and "hours" for "3600". Since "seconds" would have the value "1", there is no predefined constant "seconds".
If you want an increment of 30 seconds, simply write
set timeIncrement to 30
For example
on run {input, parameters}
(* copyright leonieDF *)
set timeIncrement to (1 * hours) + (2 * minutes) + 30
(* select at least 2 images in Aperture *)
tell application "Aperture"
activate
set imageSel to (get selection)
if imageSel is {} then
error "Please select an image."
else
tell (item 1 of imageSel)
set imageDate to value of EXIF tag "ImageDate"
--set imageDate to get the value of EXIF tag "ImageDate"
end tell
repeat with i from 2 to count of imageSel
set imageDate to imageDate + timeIncrement
adjust image date imageDate of images {item i of imageSel}
end repeat
end if
return imageSel
end tell
end run -
How can I encrypt/decrypt data in Forms using a specified Package?
Hi All,
I have searched in the Internet for ecnrypting/decrypting data in Forms.
That is when I want to query the data outside the Form Application it will be encypted, otherwise if I want to query it in the form application it will be dycrypted
I found this package:
CREATE OR REPLACE PACKAGE Encrypt_pkg AS
FUNCTION encrypt (p_text IN VARCHAR2) RETURN RAW;
FUNCTION decrypt (p_raw IN RAW) RETURN VARCHAR2;
END Encrypt_pkg;
CREATE OR REPLACE PACKAGE BODY Encrypt_pkg AS
-- All VARCHAR2 inputs are padded to multiples of 8 charaters,
-- with the encryption key also being a multiple of 8 charaters.
-- The encryption key and padding characters can be altered to suit.
g_key RAW(32767) := UTL_RAW.cast_to_raw('12345678');
g_pad_chr VARCHAR2(1) := '';
PROCEDURE padstring (p_text IN OUT VARCHAR2);
FUNCTION encrypt (p_text IN VARCHAR2) RETURN RAW IS
l_text VARCHAR2(32767) := p_text;
l_encrypted RAW(32767);
BEGIN
padstring(l_text);
DBMS_OBFUSCATION_TOOLKIT.desencrypt(input => UTL_RAW.cast_to_raw(l_text),
key => g_key,
encrypted_data => l_encrypted);
RETURN l_encrypted;
END;
FUNCTION decrypt (p_raw IN RAW) RETURN VARCHAR2 IS
l_decrypted VARCHAR2(32767);
BEGIN
DBMS_OBFUSCATION_TOOLKIT.desdecrypt(input => p_raw,
key => g_key,
decrypted_data => l_decrypted);
RETURN RTrim(UTL_RAW.cast_to_varchar2(l_decrypted), g_pad_chr);
END;
PROCEDURE padstring (p_text IN OUT VARCHAR2) IS
l_units NUMBER;
BEGIN
IF LENGTH(p_text) MOD 8 > 0 THEN
l_units := TRUNC(LENGTH(p_text)/8) + 1;
p_text := RPAD(p_text, l_units * 8, g_pad_chr);
END IF;
END;
END Encrypt_pkg;
** Now How can I use this package to encrypt/decrypt data in the form as I said Plz???<p>Read this article and go to chapter 2.3.2.</p>Inserts, Update and Delete orders are managed by a stored procedure. In the sample dialog, the Select is handled by the emp_pkg.emp_query() stored function:
PROCEDURE emp_query(emp_data IN OUT emptab) IS
ii NUMBER;
CURSOR empselect IS
SELECT empno, ename, job, sal, comm FROM emp
ORDER BY ename ;
BEGIN
OPEN empselect;
ii := 1;
LOOP
FETCH empselect INTO
emp_data( ii ).empno,
emp_data( ii ).ename,
emp_data( ii ).job,
emp_data( ii ).sal,
emp_data( ii ).comm;
EXIT WHEN empselect%NOTFOUND;
ii := ii + 1;
END LOOP;
END emp_query;In your case, all you have to do is th use your decrypt() function in the cursor definition:
CURSOR empselect IS
SELECT decrypt(empno), decrypt(ename), decrypt(job), decrypt(sal), comm FROM emp
ORDER BY ename ;
...For Insert and Update events, use the crypt() function in the related stored procedures.
PROCEDURE emp_insert2(t IN emptab) IS
BEGIN
FOR i IN t.first..t.last LOOP
INSERT INTO emp (empno, ename, job, sal, comm)
VALUES(crypt(t(i).empno), crypt(t(i).ename), crypt(t(i).job), crypt(t(i).sal, t(i).comm));
END LOOP ;
END emp_insert2;Idem for the Update procedure.
Francois -
How can I display the date a word document was last modified on my web page?
I have lists of links to word documents on my web pages. I
want to be able to show the date the word document was last
modified next to each link. My pages are straight html.
Thanks.>but I would have to go to each individual file (I have
hundreds) and put this code on each link.
No, you can use the FileSystemObject to get a list of the
files in the directory. See if you can adapt this for your site:
<link href="/CSS/dirlist.css" rel="stylesheet"
type="text/css">
<%
Function FormatSize(SizeInBytes)
if SizeInBytes > 1024^2 then
FormatSize = formatnumber(SizeInBytes / 1024^2,2) & "
MB"
elseif SizeInBytes > 1024 then
FormatSize = formatnumber(SizeInBytes / 1024,2) & " KB"
else
FormatSize = SizeInBytes & " Bytes"
end if
end function
%>
<%
dim parts
dim part
dim BrowseLine
dim RelLink
dim i
url = Request.ServerVariables("URL")
Parts = split(URL,"/")
for part = 1 to ubound(Parts)-1
' calc link
RelLink = ""
for i = 1 to ubound(Parts) - part - 1
RelLink = RelLink & "..\"
next
If trim(BrowseLine) <> "" then
BrowseLine = BrowseLine & "/"
end if
BrowseLine = BrowseLine & "<A href=" & RelLink
& ">" & parts(part) & "</A>"
next
' add "back" link
BrowseLine = Browseline & " " &
"<A href='javascript:history.back();'><img
src='/images/return.gif' border=0></A>"
Response.Write "<P class = 'NavTop'>" & BrowseLine
& "</P>"
Dim fso
set fso = server.CreateObject("Scripting.fileSystemObject")
dim fldr
dim fle
%>
<a href="../index.asp"><img
src="../images/leftbanner.jpg" width="343" height="70"
border="0"></a>
<link href="/CSS/dirlist.css" rel="stylesheet"
type="text/css">
</p>
<p></p>
<table width="85%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<th width="63%"><div
align="left"> Document
Name</div></th>
<th width="14%">Size</th>
<th width="23%"><div
align="left"> Date</div></th>
</tr>
<%
' display folders
for each fldr in
fso.GetFolder(server.MapPath(".")).SubFolders
%>
<tr>
<td class="FileName"> <a href='<%=
fldr.Name %>'><img src="/images/folder.gif" border=0>
<%= fldr.Name %></a></td>
<td class="FileSize"> <%=
FormatSize(fldr.Size) %></td>
<td class="FileDate"><div
align="left"> <%=
FormatDateTime(fldr.DateLastModified,2)
%></div></td>
</tr>
<%
next
%>
<%
' display files
for each fle in fso.GetFolder(server.MapPath(".")).Files
dim ext
ext = fso.GetExtensionName(fle.path)
if (ext <> "asp") and (ext <> "scc") then
%>
<tr>
<td class="FileName"> <a href='<%=
escape(fle.Name) %>'><img src="/images/file.gif"
width="14" height="16" border=0>
<%= fle.Name %></a></td>
<td class="FileSize"> <%=
FormatSize(fle.Size) %></td>
<td class="FileDate"><div
align="left"> <%=
FormatDateTime(fle.DateLastModified,2) %></div></td>
</tr>
<%
end if
next
Set fso = Nothing
Set fle = Nothing
Set fldr = Nothing
%>
</table>
<p><a href="/index.asp">Return to Home
Page</a></p> -
How can I get my data in Ipad that was been restored in Apple?
I just downloaded the Itune in y laptop so that I can connect my data to my Ipad. Unfortunately after downloaded the Itune, I pressed "restore" which my ipad had been connected in my laptop. Then after that, all the data from my ipad been gone like just been formatted. why? please help me if i can still access my data been restored.
The only way you can get that content back is if you have it backed up somewhere. Have you not backed up before, either in iTunes, or in iCloud?
If you have you can restore from the backup, but otherwise, your content is gone now, sorry. -
How to compare user entered date with current date
Hi all
my requirement is, user allowed select one date, in code i have compare this date with current day date. it should be 15days gap other wise display error message.
I am worried about how to get current date in code. Is there any code to get current date. please reply me with code or mail me at [email protected]
Thanx
keerthiKeerthi,
Use the method <b>getDifference()</b> of the DateHelper.java available here.<a href="http://www.koders.com/java/fid14A61FEB1B45A64E42E1DCAD7070B46AE46340BA.aspx">DateHelper</a>
1. Create a new folder, say Util under your src folder. (com.xyz.util)
2. Put this DateHelper.java file in that folder,(com.xyz.util) .
3. Now, write an import statement for this java class in the required view.
4. Use the getDifference() method of this class to the difference in days between two days.
Or
Simply use this code.
// Get msec from each, and subtract.
long diff = currDate.getTime() - selectedDate.getTime();
int noOfDays = diff / (1000 * 60 * 60 * 24);
where currDate is today's Date and selectedDate is the Date selected by the User.
Bala -
How can a user enter a value in the field which is in read mode.
Hi all,
I am creating a badi for the valuation class.when ever i execute the mm02 transaction.if an invalid valuation class is entered,my error message is poping up.but it is coming in the display mode.i should get the valuation class field in the read mode.
Regards,
charita.Hi Charita,
Use information message instead of Error message.Then it will not give u that field in non-editable mode.
<b>Reward points if it solves ur query or answer is helpful</b>
Thanks
Chinmay -
How can I restore The App store aplication it was ereased for mistake pls help
App store ereased HELP
Natively-installed apps cannot be deleted or removed in iOS.
Are you sure it didn't accidentally get moved to a different screen, or placed into a folder? -
How can we give the Data Format (File Type ) in Runtime
Hi all,
How can we give the Data Format (File Type ) in Runtime for the following method,
cl_gui_frontend_services=>gui_download.
Thanks in advance
SriThere is a filetype parameter which you can set
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
* BIN_FILESIZE =
filename =
* FILETYPE = 'ASC'
* APPEND = SPACE
* WRITE_FIELD_SEPARATOR = SPACE
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = SPACE
* WRITE_LF = 'X'
* COL_SELECT = SPACE
* COL_SELECT_MASK = SPACE
* DAT_MODE = SPACE
* CONFIRM_OVERWRITE = SPACE
* NO_AUTH_CHECK = SPACE
* CODEPAGE = SPACE
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = SPACE
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* IMPORTING
* FILELENGTH =
changing
data_tab =
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* NOT_SUPPORTED_BY_GUI = 22
* ERROR_NO_GUI = 23
* others = 24 -
Hi, How can we assign enter function key to ok_code
Hi,
How can we assign enter function key to ok_codehi,
ok code for ener key is /00
Chk this Link.
http://abap4.tripod.com/OK_Code_Values.html
Rgds
Anversha -
I have macbook without a firewire port, I have usb 2.0 port, now my os is not working I can not get through apple logo loading , I can not enter safe mode, I can only enter one user mode, how can I backup my data, I have very important data in my hdd
Here is what worked for me:
My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc. -
How can I read the last cell of a JTable that a user Enters data
I have a one column JTable with several rows that a user enters data to. Upon entering the last data, the user clicks a button to read all the data from the rows in the JTable and puts them in an arraylist. If the user does not click enter or navigates away from the last cell, then after clicking the button it does not read the last cell entered. Since the user is clicking on a button to indicate he is done entering data on the table, does he also have to hit the enter key to indicate he is done entering the data?
The code below is my tablemodelListener:
public class InteractiveTableModelListener implements TableModelListener {
public void tableChanged(TableModelEvent evt) {
if (evt.getType() == TableModelEvent.UPDATE) {
int row = evt.getFirstRow();
System.out.println("Update row:"+" "+row);
jTable1.setRowSelectionInterval(row, row);
}Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
In the future, Swing related questions should be posted in the Swing fourm. (This question has been asked and answered dozens of times).
But there is not need to repost because [Table Stop Editing|http://www.camick.com/java/blog.html?name=table-stop-editing] explains whats happening and give a couple of solutions. -
How to get the user entered data?
Hi all,
I have created an HTMLB DynPage component.
In That i have created my input screen with textboxes using response.write method.
i have added one onConfirm event on which the data whould validate.
so onConfirm method im trying to get the data with request.getParameter method which returns null...
how to do...how to get the user entered data to do my validations...can anyone plz advice.
Thanks,
ViswesHi
inputfield or textbox component entered directly using response.write(...) are not htmlb , but html.
to create portal input field (ie HTMLB), you should do something like
this in the doProcessBeforeOutput member function
InputField field1 = new InputField("Id1");
field1.setSize(8); // 8 characters
this.getForm().addComponent(field1);
and in doProcessAfterInput member function
InputField field1 =
(InputField) this.getComponentByName("Id1");
you can then manipulate the content of the field.
Hope this help,
Guillaume
Maybe you are looking for
-
Power Mac G5 Tower starts up, but no display...
I've got a PowerMac G5 tower that powers up, I hear the fans ramping up, but no display > black screen. I've tried 2 different monitors...same thing. What could this be? PRAM? Thanks for any expertise, Sunny
-
How to get notified the AO profile has been finished
I am generationg an output analog profile usling the NI PCI-6014 DAQ (Windows2000/XP environment and VC++ 6 are used). My goal is to generate it once, but I do not want to make a synchronous call having a real-time application. So what I am doing is
-
How do I raise a new event?
someone can i help me, I am designing a hardware and I want to make a package avaible for use it. I was reviewing the java code but I do not know how begin it. The hardware uses the serial port, and i would like something like this: class HandleMyHar
-
Hi All I am working on translations of webdynpro . I followed tutorial in SDN for webdynpro Internationalization. I was able to translate iview into German successfully but not able to get for France and Spanish. I added .xlf like _de.xlf for german
-
ORA-04030: out of process memory Loading Large XML File
Experts: I am trying to load a 2.1G XML file into an Object Relational table . The xml schema document xsd is already registered successfully. It fails with the following error : ORA-04030: out of process memory when trying to allocate 4032 bytes (qm